1.3.20 • Published 2 months ago

@debut/indicators v1.3.20

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 months ago

npm npm NPM GitNFT

Streaming Technical Indicators

High performance for you trading application

The main feature of these indicators is their continuous operation, which means that you can use them both for real trading and for teaching trading strategies on history, since this is a passage from the beginning to the end of the stream of candles. This approach allows you to reduce the number of necessary calculations by tens of times and is the most optimal in terms of performance.

Features

  • High performance
  • Easy to use with candles streaming
  • Minimal state for calculation
  • Moment value (possible to calculate every tick)
  • Typescript
  • Unit Tested / Cross SDK Validated

Available Indicators

  • Accelerator Oscillator (AO).
  • Average True Range (ATR)
  • Awesome Oscillator (AC).
  • Average Directional Index (ADX).
  • Bollinger Bands (BB).
  • Chaikin Oscillator
  • Commodity Channel Index (CCI).
  • Connor's RSI (CRSI)
  • Donchian channels (DC).
  • Exponential Moving Average (EMA).
  • Exponential Weighted Moving Average (EWMA).
  • Linearly weighted moving average (LWMA).
  • Moving Average Convergence Divergence (MACD).
  • Pivot Point Levels (classic / woodie /camarilla / fibonacci).
  • Rate of Change (ROC).
  • Relative Strength Index (RSI).
  • Simple Moving Average (SMA).
  • Smoothed Moving Average (SMMA).
  • SuperTrend MTF (ST MTF).
  • Stochastic Oscillator (KD)
  • Stochastic Rsi (KD)
  • Wilder's Smoothed Moving Average (WEMA)
  • Welles Wilder's Smoothing Average (WWS)
  • Weighted moving average (WMA)
  • Parabolic Stop And Reverse (PSAR)
  • Volume Profile

Candles

  • Heiken Ashi.

Utils

  • Standard Deviation (SD).
  • Correlation.
  • Circullar buffer. This is simple streaming array for pop and push (performance optimized).
  • Sampler. This is sample creator, for indicators like SMA, for easy getting SMA(SMA(SMA(SMA())) some sampled x-times values.
  • UniLevel. Dynamic levels for single number value 0 balanced (values between -N and +N).

Next value (indicator.nextValue)

This method allows you to get the current value of the indicator, usually performed according to the data of a closed candle. The method call affects all subsequent calculations of the indicator readings.

Moment value (indicator.momentValue)

The method of calculating the instantaneous value of the indicator allows you to obtain information about the indicator readings in real time, without affecting future readings. This allows you to work with the indicator inside the candle.

Download

Releases are available under Node Package Manager (npm):

npm install @debut/indicators

Example with Simple Moving Average

import { SMA } from '@debut/indicators';
const sma = new SMA(4); // Create SMA with 4 period

// SMA workflow
//=> [ '2.50', '3.50', '4.50', '5.50', '6.50', '7.50' ]
//=>   │       │       │       │       │       └─(6+7+8+9)/4
//=>   │       │       │       │       └─(5+6+7+8)/4
//=>   │       │       │       └─(4+5+6+7)/4
//=>   │       │       └─(3+4+5+6)/4
//=>   │       └─(2+3+4+5)/4
//=>   └─(1+2+3+4)/4

sma.nextValue(1); // undefined
sma.nextValue(2); // undefined
sma.nextValue(3); // undefined
sma.nextValue(4); // 2.50
sma.nextValue(5); // 3.50
sma.nextValue(6); // 4.50
sma.nextValue(7); // 5.50
sma.momentValue(8); // 6.50
sma.nextValue(8); // 6.50
sma.momentValue(9); // 7.50
sma.nextValue(9); // 7.50

Extra custom indicators

  • MOVE (direction move with power no less than p)
  • WAVE (directional move with bearish or bullish candle series and power p)

Benchmarks

Apple M1 Pro, Node v16.14.0. Tested on dateset with 100k elements.

Indicator name@debut/indicators (ops/sec)technicalindicators (ops/sec)indicatorts (ops/sec)
AwesomeOscillator31823158
ADX35842x
ATR61313695
Bollinger Bands3479219
CCI15112158
DC474x74
PSAR1,453278666
EMA1,7204521,537
MACD1,41790467
ROC3,62564x
RSI1,23938315
SMA67865645
WEMA1,462455x
WMA28741x
Stochastic3402567

Benchmarks results is autogenerated by https://github.com/follow-traders/indicators-benchmark

1.3.20

2 months ago

1.3.17

1 year ago

1.3.18

1 year ago

1.3.16

1 year ago

1.3.19

12 months ago

1.3.14

1 year ago

1.3.15

1 year ago

1.3.13

2 years ago

1.3.12

2 years ago

1.3.7

2 years ago

1.3.10

2 years ago

1.3.11

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.9

2 years ago

1.2.10

2 years ago

1.2.0

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.0

3 years ago

1.1.3-beta.0

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.5.2-beta.0

3 years ago

0.5.0

3 years ago

0.5.1

3 years ago

0.4.10

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.0

3 years ago