@aduryagin/technical-indicators
TypeScript icon, indicating that this package has built-in type declarations

0.0.30 • Public • Published

Technical indicators

npm version

Technical indicators with possibility of update/add last item (candle) of result. This may be usefull when use realtime streaming (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 } }
  */

Package Sidebar

Install

npm i @aduryagin/technical-indicators

Weekly Downloads

5

Version

0.0.30

License

MIT

Unpacked Size

229 kB

Total Files

102

Last publish

Collaborators

  • aiduryagin