Terminal documentation

Quasar Trading Terminal and the QuasarGen Script indicator language

QuasarGen Script reference

Series, functions, output and settings — assembled from the language inventory in the code.

This reference is assembled from the language inventory inside the terminal's code: if a function is named here it works, and if it works it is named here.

Candle series

NameWhat it isArguments
openThe bar's open pricenone
highThe bar's highest pricenone
lowThe bar's lowest pricenone
closeThe bar's close pricenone
volumeThe bar's volumenone
hl2Bar midpoint: (high + low) / 2none
hlc3Typical price: (high + low + close) / 3none
ohlc4Average of the bar's four pointsnone
bar_indexBar number from the start of historynone
timeBar time, epoch secondsnone

Functions

NameWhat it doesArguments
ta.smaSimple moving averagesource — the series to compute over; length — window length, constant
ta.emaExponential moving average; seeded with an SMA over the periodsource — the series; length — window length, constant
ta.rmaWilder's smoothing (as in RSI and ATR)source — the series; length — window length, constant
ta.rsiRelative strength index, 0…100source — the series; length — window length, constant
ta.atrAverage true rangelength — window length, constant
ta.trTrue range of the current barnone
ta.highestHighest value over the windowsource — the series; length — window length, constant
ta.lowestLowest value over the windowsource — the series; length — window length, constant
ta.stdevStandard deviationsource — the series; length — window length, constant
ta.changeDifference from the previous barsource — the series
ta.crossover1 on the bar where the first series crosses the second upwardssource1 — first series; source2 — second series
ta.crossunder1 on the bar where the first series crosses the second downwardssource1 — first series; source2 — second series
math.absAbsolute valuex — a number
math.sqrtSquare rootx — a number
math.logNatural logarithmx — a number
math.roundRoundingx — a number
math.signSign of a number: −1, 0 or 1x — a number
math.maxThe greater of twox — first; y — second
math.minThe lesser of twox — first; y — second
math.powRaise to a powerx — base; y — exponent
nzReplace “no value” with a replacement (or zero)source — the series; replacement — what to use instead (optional)
na1 when there is no valuesource — the series

Drawing on the chart

NameWhat it doesArguments
indicatorThe indicator header: its name and where to drawtitle — indicator name; overlay — over the candles or in its own pane (optional); precision — decimal places (optional)
plotDraw a series as a lineseries — what to draw; title — line label (optional); color — colour (optional); width — thickness (optional); style — line kind: 0 line, 5 histogram (optional); offset — shift in bars: forward (+) or back (−) (optional)
hlineA horizontal line at a given priceprice — the price; title — label (optional); color — colour (optional)
fillFill between two plotted linesplot1 — first line; plot2 — second line; color — colour when the first line is above (optional); colorDown — colour when it is below (optional); opacity — density, percent (optional)

Indicator settings

NameWhat it doesArguments
input.intAn integer settingtitle — label in the form; defval — default value; minval — no less than (optional); maxval — no more than (optional)
input.floatA fractional settingtitle — label; defval — default; minval — no less than (optional); maxval — no more than (optional)
input.boolA switchtitle — label; defval — default
input.stringA text settingtitle — label; defval — default
input.colorA colour settingtitle — label; defval — default
input.sourceA series picker: close, hl2 and the resttitle — label; defval — default

Colours

NameWhat it doesArguments
color.rgbAn exact colour from componentsr — red 0…255; g — green; b — blue; a — opacity (optional)
color.bullThe theme's colour for a risenone
color.sellThe theme's colour for a fallnone
color.textMain text colournone
color.softMuted colournone
color.accentAccent colournone
color.gridGrid colournone