Overlay indicators plot directly on the main candlestick pane alongside active studies.
MA (Simple Moving Average)
- Defaults:
calcParams: [5, 10, 30, 60]on candle closes (c). - Formula: Neumaier-compensated rolling sum divided by
period. First valid value at barperiod - 1. - Nuance: Compensated addition eliminates cumulative floating-point drift when removing stale values from long streams.
EMA (Exponential Moving Average)
- Defaults:
calcParams: [6, 12, 20]on candle closes (c). - Formula: Smoothing factor
k = 2 / (period + 1), seeded with the arithmetic mean (SMA) of the firstperiodcloses (matching TA-LibEMA), thenprev = (x[i] - prev) * k + prev. - Nuance: Because seeding uses an exact
period-bar SMA rather thanx[0], early values stay aligned with institutional charting packages and TA-Lib.
BOLL (Bollinger Bands)
- Defaults:
calcParams: [20, 2](period = 20,mult = 2). - Outputs:
UP,MID,DN(bandwidthand%bare also computed in the reference kernelbbands()). - Formula:
MID = SMA(close, 20)σ = population standard deviation(ddof = 0), computed via a two-pass variance loop over eachperiodwindow aroundMID(avoiding catastrophic cancellation from one-passE[x²] - E[x]²).UP = MID + mult * σ,DN = MID - mult * σ.
VWAP (Session Volume-Weighted Average Price)
- Defaults:
calcParams: [1, 2](±1σand±2σdashed bands around solid accentVWAP). - Timeframe-aware UTC reset (
inferVwapAnchor):
| Chart interval | Reset cadence | Bucket key |
|---|---|---|
1m, 5m, 15m, 1h |
Daily 00:00 UTC |
floor(ms / 86_400_000) |
4h |
Weekly Monday 00:00 UTC |
floor((ms + 3 * 86_400_000) / (7 * 86_400_000)) |
1d |
Monthly 1st 00:00 UTC |
UTCYear * 12 + UTCMonth |
- Formula: Accumulates typical price
tp = (h + l + c) / 3weighted by positive volumev > 0using West-Welford weighted online variance (sd = sqrt(m2 / wSum)). Zero-volume bars carry forward the running mean and variance without corrupting weights (emittingNaNonly if cumulative session volume is still0). - Incremental parity: The resumable kernel (
incremental.ts) checkpoints[curBucket, wSum, mean, m2]before the forming bar and executes the exact same floating-point operations as batchvwap(), matching bit-for-bit (Object.is).
SUPERTREND
- Defaults:
calcParams: [10, 3](period = 10,mult = 3), short labelST. - Outputs:
UP(green trailing support stop while bullish;NaNwhen bearish) andDN(red trailing resistance stop while bearish;NaNwhen bullish). - Formula:
- Computes Wilder-smoothed
ATR(period)starting frommean(TR[1..period])at barperiod. - Raw bands around midpoint
hl2 = (h + l) / 2:rawUp = hl2 - mult * atr,rawDn = hl2 + mult * atr. - Trailing ratchet:
fUp = (rawUp > prevUp || c[i - 1] < prevUp) ? rawUp : prevUpfDn = (rawDn < prevDn || c[i - 1] > prevDn) ? rawDn : prevDn
- Direction flips only on a confirmed close beyond the active trailing stop (
c[i] < fUpflips bearish;c[i] > fDnflips bullish).
- Computes Wilder-smoothed