Indicators
Technical indicators for cryptocurrencies, stocks and forex. To work with historical and real price data. One of the most efficient Javascript library implementations. The library has such indicators as: Relative Strength Index (RSI), Moving Average C / D (MACD), Average Directional Index (ADX), Stochastic Oscillator, Bollinger Bands, Average True Range (ATR) and many others
Install / Use
npx skills add debut-js/IndicatorsInstalls into whichever agent you are using.
README
Streaming Technical Indicators
Sponsored by Backticks — a visual canvas to build, backtest and optimize trading strategies in your browser. Built on top of this library.
A streaming, allocation-light technical-analysis toolkit for JavaScript / TypeScript. Every indicator is a class with a nextValue(...) method that consumes one bar at a time, so the same code path drives both backtests and live trading without rebuilding state. A second method, momentValue(...), computes the indicator's value for a hypothetical bar without committing any state — useful for tick-by-tick recalculation inside an unfinished candle.
Features
- Streaming-first. O(period) per bar; no full-array recomputation.
momentValueeverywhere. Ask "what would the value be if this bar closed now?" without mutating state.- TypeScript. Strongly-typed across the public surface.
- Cross-SDK validated. 130+ jest tests cross-check our output against external reference libraries (
lwcandti) with epsilon ≤ 1e-9. See the Test column in the indicator tables below for which oracle each one is verified against. - Tiny package. Ships only the prebuilt
lib/bundle — ~85 kB tarball.
Install
npm install @debut/indicators
Quick start
import { SMA, RSI, MACD, BollingerBands } from '@debut/indicators';
const sma = new SMA(20);
const rsi = new RSI(14);
const macd = new MACD(12, 26, 9);
const bb = new BollingerBands(20, 2);
for (const bar of bars) {
const sm = sma.nextValue(bar.close);
const r = rsi.nextValue(bar.close);
const m = macd.nextValue(bar.close); // → { macd, signal, histogram }
const b = bb.nextValue(bar.close); // → { lower, middle, upper }
// ...indicator outputs are `undefined` until each one's warmup completes.
}
nextValue returns undefined until the indicator has seen enough bars to produce a result (its "warmup" — typically period bars). After that it returns the current value on every call.
Streaming model
nextValue(...) — close-of-bar
Call this once per closed bar. The method advances internal state and returns the new indicator value. Subsequent calls reflect the committed state.
momentValue(...) — intra-bar
Call this with the live (still-forming) candle's price/volume to read what the indicator would report if the bar closed now, without committing any state. Useful when you want to react inside the candle but recompute cleanly when the next real nextValue arrives.
const sma = new SMA(4);
[1, 2, 3].forEach((v) => sma.nextValue(v)); // warmup
sma.momentValue(8); // 3.5 ← preview if close=8
sma.nextValue(4); // 2.5 ← actual close=4 commits state
sma.momentValue(8); // 4.75 ← preview based on committed state
sma.nextValue(8); // 4.25 ← actual close=8 commits state
Available indicators
Below is the full catalog grouped by category. Names in code style are the exact named export from @debut/indicators. Linkable indicator names lead to a per-indicator doc page in docs/. The Test column marks which external library the cross-SDK validation runs against — `lwc` = lightweight-charts-indicators, `ti` = technicalindicators (see Cross-SDK validation for what that means).
Moving Averages
| Indicator | Export | Test | Description |
|-----------|--------|------|-------------|
| Simple Moving Average | SMA | ti | Arithmetic mean over a period. |
| Exponential Moving Average | EMA | ti | Weighted average emphasizing recent prices. |
| Weighted Moving Average | WMA | ti | Linearly increasing weights toward the latest bar. |
| Linearly Weighted MA | LWMA | | Linear weighting variant. |
| Exponential Weighted MA | EWMA | | Configurable α; lighter than EMA for tick smoothing. |
| Smoothed Moving Average | SMMA | | Wilder smoothing (α = 1/period). |
| Wilder's Smoothed MA | WEMA | ti | Same shape as RMA, included for compatibility. |
| Welles Wilder's Smoothing | WWS | | Classic Wilder smoothing. |
| Adaptive Moving Average | AMA | | Kaufman adaptive — speeds up in trend, slows in chop. |
| Running Moving Average | RMA | | α = 1/period; SMA-seeded. |
| Hull Moving Average | HMA | lwc | Reduced-lag MA via WMA chaining. |
| Double EMA | DEMA | lwc | 2 × EMA − EMA(EMA). |
| Triple EMA | TEMA | | Three-stage EMA reduction of lag. |
| Arnaud Legoux MA | ALMA | lwc | Gaussian-weighted MA. |
| Volume Weighted MA | VWMA | lwc | Each bar weighted by volume. |
| McGinley Dynamic | McGinleyDynamic | lwc | Self-adjusting MA reacting to market speed. |
| Least Squares MA | LSMA | lwc | Endpoint of rolling linear regression. |
Oscillators
| Indicator | Export | Test | Description |
|-----------|--------|------|-------------|
| Relative Strength Index | RSI | ti | Classic 14-period momentum oscillator. |
| Stochastic | Stochastic | ti | Close vs. high-low range. |
| Stochastic RSI | StochasticRSI | ti | Stochastic applied to RSI. |
| Commodity Channel Index | CCI | ti | Deviation-from-mean cyclic oscillator. |
| Williams %R | Williams | | Inverse-stochastic momentum. |
| Awesome Oscillator | AO | ti | Bill Williams 5/34 SMA difference of HL2. |
| Accelerator Oscillator | AC | | Bill Williams AO derivative. |
| Chande Momentum Oscillator | CMO | | Wilder-style CMO. |
| Chande MO (LWC) | ChandeMO | lwc | LWC reference variant; raw rolling sums. |
| Detrended Price Oscillator | DPO | | SMA-detrended price. |
| Relative Vigor Index | RVI | lwc | SWMA-based vigor / signal pair. |
| SMI Ergodic | SMIErgodic | lwc | Double-smoothed momentum (TSI without 100×). |
| True Strength Index | TSI | lwc | Double-EMA momentum oscillator with signal. |
| Bollinger Bands %B | BBPercentB | lwc | Price position relative to BB. |
| Fisher Transform | FisherTransform | lwc | Gaussian-mapped price extremes. |
| Ultimate Oscillator | UltimateOscillator | | Multi-timeframe weighted momentum. |
| Connor's RSI | cRSI | | Composite RSI / streak / percent-rank. |
| Relative Volatility Index | RelativeVolatilityIndex | lwc | RSI on stdev of close. |
Momentum
| Indicator | Export | Test | Description |
|-----------|--------|------|-------------|
| MACD | MACD | ti | Difference of two EMAs with signal/histogram. |
| Momentum | Momentum | lwc | close − close[length]. |
| Rate of Change | ROC | ti | Percentage change over a period. |
| Balance of Power | BOP | lwc | (close − open) / (high − low). |
| Bull-Bear Power | BullBearPower | lwc | Elder: high + low − 2·EMA(close). |
| Force Index | ForceIndex | | Elder: signed price-volume impulse. |
| Elder Ray | ElderRay | | Bull / bear power split. |
| Price Oscillator | PriceOscillator | lwc | Percent-PPO with signal/histogram. |
| Coppock Curve | CoppockCurve | lwc | WMA of summed long/short ROCs. |
| TRIX | TRIX | ti | ROC of triple-smoothed EMA. |
| KST | KST | lwc | "Know Sure Thing" weighted ROC sum + signal. |
Trend
| Indicator | Export | Test | Description |
|-----------|--------|------|-------------|
| Average Directional Index | ADX | ti | Trend strength irrespective of direction. |
| Directional Movement Index | DMI | | +DI, −DI, ADX. |
| Ichimoku Cloud | Ichimoku | | Conversion / base / spans / lagging. |
| Parabolic SAR | PSAR | ti | Welles Wilder's trailing stop. |
| Supertrend | SuperTrend | | ATR-based dynamic support/resistance. |
| Aroon | Aroon | lwc | Bars-since-extreme up/down lines. |
| Choppiness | Choppiness | lwc | Range-vs-volatility chop measure. |
| Mass Index | MassIndex | lwc | Reversal detection via H-L EMA ratio. |
| Vortex | Vortex | lwc | VI+ / VI− directional pair. |
| Trend Strength Index | TrendStrengthIndex | lwc | Pearson correlation of close vs. bar index. |
| Chande Kroll Stop | ChandeKrollStop | lwc | Long / short ATR-based stop levels. |
Volatility
| Indicator | Export | Test | Description |
|-----------|--------|------|-------------|
| Average True Range | ATR | ti | Wilder ATR with selectable smoothing. |
| Average Daily Range | ADR | lwc | SMA of high − low. |
| Historical Volatility | HistoricalVolatility | lwc | Annualized stdev of log returns. |
| Bollinger BandWidth | BBBandWidth | lwc | (upper − lower) / basis × 100. |
| Standard Deviation | StandardDeviation | | Streaming biased stdev provider. |
Channels & Bands
| Indicator | Export | Test | Description |
|-----------|--------|------|-------------|
| Bollinger Bands | BollingerBands | ti | SMA ± k × stdev. |
| Donchian Channels | DC | | Highest-high / lowest-low envelop
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.6kCommit, push, and open a PR
