Skip to content

Technical indicators with possibility of update/add last item (candle) of result. This may be useful when use realtime (for example WebSockets) data.

Notifications You must be signed in to change notification settings

e20916/technical-indicators

 
 

Repository files navigation

Technical indicators

npm version

Technical indicators with possibility of update/add last item (candle) of result. This may be usefull when use realtime (for example WebSockets) data.

Indicators

Example

const candles = [
    { time: 0, close: 12.2 },
    { time: 1, close: 12.4 },
    { time: 2, close: 13 }
  ];
  const period = 1;
  const rsi = RSI({ candles, period });
  console.log(rsi);
  /*
    {
      result: [
        { time: 1, value: 100, candle: { time: 1, close: 12.4 } },
        { time: 2, value: 100, candle: { time: 2, close: 13 } }
      ],
      update: [Function: update]
    }
  */
  const rsiResult = rsi.update({ time: 2, close: 1 });
  console.log(rsiResult);
  /*
    { time: 2, value: 0, candle: { time: 2, close: 1 } }
  */

About

Technical indicators with possibility of update/add last item (candle) of result. This may be useful when use realtime (for example WebSockets) data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.5%
  • JavaScript 0.5%