QuasarGen Script reference
This reference is assembled from the language inventory in the terminal source. Capabilities added after the latest release are marked separately; users can run them once the corresponding build is released.
Candle series
| Name | What it is | Arguments |
|---|---|---|
open | The bar's open price | none |
high | The bar's highest price | none |
low | The bar's lowest price | none |
close | The bar's close price | none |
volume | The bar's volume | none |
hl2 | Bar midpoint: (high + low) / 2 | none |
hlc3 | Typical price: (high + low + close) / 3 | none |
ohlc4 | Average of the bar's four points | none |
bar_index | Bar number from the start of history | none |
time | Bar time, epoch seconds | none |
Functions
| Name | What it does | Arguments |
|---|---|---|
ta.sma | Simple moving average | source — the series to compute over; length — window length, constant |
ta.ema | Exponential moving average; seeded with an SMA over the period | source — the series; length — window length, constant |
ta.rma | Wilder's smoothing (as in RSI and ATR) | source — the series; length — window length, constant |
ta.rsi | Relative strength index, 0…100 | source — the series; length — window length, constant |
ta.atr | Average true range | length — window length, constant |
ta.tr | True range of the current bar | none |
ta.highest | Highest value over the window | source — the series; length — window length, constant |
ta.lowest | Lowest value over the window | source — the series; length — window length, constant |
ta.median | Window median; for an even length, the upper middle value. Added to source on 15 Nov 2026; unavailable in released builds so far. | source — numeric series; length — constant or input.int, 1…4096 |
ta.stdev | Standard deviation | source — the series; length — window length, constant |
ta.change | Difference from the previous bar | source — the series |
ta.crossover | 1 on the bar where the first series crosses the second upwards | source1 — first series; source2 — second series |
ta.crossunder | 1 on the bar where the first series crosses the second downwards | source1 — first series; source2 — second series |
state.capture | Holds the value saved on the latest event bar; na before the first event. Added to source on 15 Nov 2026; unavailable in released builds so far. | trigger — finite nonzero value fires; source — series to save |
state.peak | Maximum of finite source values since the latest event, including its bar; na before the first event. Added to source on 15 Nov 2026; unavailable in released builds so far. | trigger — finite nonzero value begins a new segment; source — series for the maximum |
math.abs | Absolute value | x — a number |
math.sqrt | Square root | x — a number |
math.log | Natural logarithm | x — a number |
math.round | Rounding | x — a number |
math.sign | Sign of a number: −1, 0 or 1 | x — a number |
math.max | The greater of two | x — first; y — second |
math.min | The lesser of two | x — first; y — second |
math.pow | Raise to a power | x — base; y — exponent |
nz | Replace “no value” with a replacement (or zero) | source — the series; replacement — what to use instead (optional) |
na | 1 when there is no value | source — the series |
Drawing on the chart
| Name | What it does | Arguments |
|---|---|---|
indicator | The indicator header: its name and where to draw | title — indicator name; overlay — over the candles or in its own pane (optional); precision — decimal places (optional) |
plot | Draw a series as a line | series — what to draw; title — line label (optional); color — colour (optional); width — thickness (optional); style — kind: 0 line, 5 histogram, 10 circles (optional); offset — shift in bars: forward (+) or back (−) (optional) |
hline | A horizontal line at a given price | price — the price; title — label (optional); color — colour (optional) |
fill | Fill between two plotted lines | plot1 — 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) |
profile.session | Session profile of available candle volume, with POC and value area | startHourUtc — UTC session start hour, 0…23; rows — maximum price rows; valueAreaPct — value-area volume percent; mode — 0 total, 1 up/down, 2 delta (optional); showPoc, showValueArea — level visibility (optional); widthPct — histogram width as 5…80% of session (optional); placement — 0 left, 1 right (optional); showBackground — session backdrop (optional); extendPoc, extendVah, extendVal — extend levels right until first touch (optional); upColor, downColor, pocColor, valueAreaColor, backgroundColor — colours (optional) |
The profile uses available chart candles: each candle's volume is distributed across price rows in proportion to overlap with its low…high range. Detail changes with zoom. This is an approximation: lower-timeframe data is not fetched specifically for this indicator, and Forex/CFD volume may be tick volume. Missing volume is never fabricated.
Indicator settings
| Name | What it does | Arguments |
|---|---|---|
input.int | An integer setting | title — label in the form; defval — default value; minval — no less than (optional); maxval — no more than (optional); group — Arguments or Style tab (optional) |
input.float | A fractional setting | title — label; defval — default; minval — no less than (optional); maxval — no more (optional); group — Arguments or Style tab (optional) |
input.bool | A switch | title — label; defval — default; group — Arguments or Style tab (optional) |
input.string | A text setting | title — label; defval — default; group — Arguments or Style tab (optional) |
input.color | A colour setting | title — label; defval — default; group — Arguments or Style tab (optional) |
input.source | A series picker: close, hl2 and the rest | title — label; defval — default; group — Arguments or Style tab (optional) |
Colours
| Name | What it does | Arguments |
|---|---|---|
color.rgb | An exact colour from components | r — red 0…255; g — green; b — blue; a — opacity (optional) |
color.bull | The theme's colour for a rise | none |
color.sell | The theme's colour for a fall | none |
color.text | Main text colour | none |
color.soft | Muted colour | none |
color.accent | Accent colour | none |
color.grid | Grid colour | none |