@vulcan-js/indicators
v0.2.0
Published
Technical analysis indicators with generator-based streaming and high-precision arithmetic
Maintainers
Readme
@vulcan-js/indicators
Technical analysis indicators for the Vulcan library, built on generator-based streaming with high-precision decimal arithmetic (dnum).
Installation
pnpm add @vulcan-js/indicatorsUsage
Every indicator is a generator function. Pass an iterable source and iterate over the results:
import { collect } from '@vulcan-js/core'
import { sma } from '@vulcan-js/indicators'
const prices = [10, 11, 12, 13, 14, 15]
// Collect all results into an array
const results = collect(sma(prices, { period: 3 }))
// Or iterate lazily
for (const value of sma(prices, { period: 3 })) {
console.log(value) // Dnum tuple: [bigint, number]
}Use .create() to get a stateful processor for real-time / streaming scenarios:
import { rsi } from '@vulcan-js/indicators'
const process = rsi.create({ period: 14 })
process(100) // feed prices one by one
process(102)
process(98)Supported Indicators
Trend
| Indicator | Function | Alias |
| --- | --- | --- |
| Aroon Indicator | aroon | — |
| Balance of Power | bop | balanceOfPower |
| Chande Forecast Oscillator | cfo | chandeForecastOscillator |
| Double Exponential Moving Average | dema | doubleExponentialMovingAverage |
| Exponential Moving Average | ema | exponentialMovingAverage |
| Ichimoku Cloud | ichimokuCloud | — |
| MACD | macd | movingAverageConvergenceDivergence |
| Moving Max | mmax | movingMax |
| Moving Min | mmin | movingMin |
| Moving Sum | msum | — |
| Parabolic SAR | psar | parabolicSar |
| Qstick | qstick | qstickIndicator |
| Rolling Moving Average | rma | rollingMovingAverage |
| Simple Moving Average | sma | simpleMovingAverage |
| Since Change | since | sinceChange |
| Triple Exponential Average | trix | tripleExponentialAverage |
| Triple Exponential Moving Average | tema | tripleExponentialMovingAverage |
| Triangular Moving Average | trima | triangularMovingAverage |
| Typical Price | typicalPrice | typicalPriceIndicator |
| Volume Weighted Moving Average | vwma | volumeWeightedMovingAverage |
| Vortex Indicator | vortex | vortexIndicator |
| ADX/DMI | — | TODO |
| SuperTrend | — | TODO |
| ALMA | — | TODO |
| ZigZag | — | TODO |
Momentum
| Indicator | Function | Alias |
| --- | --- | --- |
| Absolute Price Oscillator | apo | absolutePriceOscillator |
| Awesome Oscillator | ao | awesomeOscillator |
| Chaikin Oscillator | cmo | chaikinOscillator |
| Commodity Channel Index | cci | commodityChannelIndex |
| Percentage Price Oscillator | ppo | percentagePriceOscillator |
| Percentage Volume Oscillator | pvo | percentageVolumeOscillator |
| Price Rate of Change | roc | priceRateOfChange |
| Random Index (KDJ) | kdj | randomIndex |
| Relative Strength Index | rsi | relativeStrengthIndex |
| Stochastic Oscillator | stoch | stochasticOscillator |
| Williams %R | willr | williamsR |
| Money Flow Index | — | TODO |
| Ultimate Oscillator | — | TODO |
| True Strength Index | — | TODO |
Volatility
| Indicator | Function | Alias |
| --- | --- | --- |
| Mass Index | mi | massIndex |
| Average True Range | — | TODO |
| Bollinger Bands | — | TODO |
| Keltner Channels | — | TODO |
| Donchian Channels | — | TODO |
| Standard Deviation | — | TODO |
Volume
| Indicator | Function | Alias |
| --- | --- | --- |
| Accumulation/Distribution | ad | accumulationDistribution |
| On-Balance Volume | — | TODO |
| VWAP | — | TODO |
| Force Index | — | TODO |
| Ease of Movement | — | TODO |
License
MIT
