Kami implements all 12 chart indicators with custom O(1) resumable kernels (src/chart/incremental.ts) rather than KLineChart’s built-in math. Every indicator is verified bit-for-bit (Object.is) against the batch reference implementations in src/ta/indicators.ts and validated against TA-Lib golden outputs.
All 12 Rolling Indicators
| Indicator | Name | Placement | Default parameters | Outputs |
|---|---|---|---|---|
MA |
Moving averages | Price overlay | [5, 10, 30, 60] |
ma1..ma4 |
EMA |
Exponential moving averages | Price overlay | [6, 12, 20] |
ema1..ema3 |
BOLL |
Bollinger bands | Price overlay | [20, 2] |
UP, MID, DN |
VWAP |
Volume-weighted average price | Price overlay | [1, 2] (σ bands) |
VWAP, ±1σ, ±2σ |
SUPERTREND |
Supertrend | Price overlay | [10, 3] |
UP, DN |
VOL |
Volume | Sub-pane | [5, 10, 20] |
Volume bars + 3 SMAs |
RSI |
Relative strength index | Sub-pane | [6, 12, 24] |
rsi1..rsi3 |
MACD |
MACD | Sub-pane | [12, 26, 9] |
DIF, DEA, histogram |
ATR |
Average true range | Sub-pane | [14] |
ATR |
ADX |
Average directional index | Sub-pane | [14] |
ADX, +DI, -DI |
STOCHRSI |
Stochastic RSI | Sub-pane | [14, 14, 3, 3] |
%K, %D |
OBV |
On-balance volume | Sub-pane | [20] |
OBV, MA signal |
Numerical & Performance Guarantees
O(1)per live tick: When a live trade updates the forming candle or appends a new bar,calcRows()checkpoints kernel state right before barn - 1and recomputes only the changed bar (~0.012 msper tick across all 12 indicators on2,000candles).- Neumaier-compensated rolling sums:
MA,VOLaverages,BOLLmiddle band,STOCHRSIsmoothing, andOBVuse Neumaier error-compensated summation so year-long1mseries never suffer floating-point drift. - TA-Lib seeding:
EMAseeds with the simple mean of its firstperiodvalues;RSI,ATR,ADX, andSUPERTRENDuse Wilder’s RMA warm-up (periodchanges orTR[1..period]). Warm-upNaNbars are omitted from chart rows so nothing draws prematurely. - Phone pane cap: On compact touch viewports (
chart.panes: off), enabling a new sub-pane indicator replaces the previous sub-pane indicator; tablets and desktops support multiple stacked panes.