JSPM

  • Created
  • Published
  • Downloads 305
  • Score
    100M100P100Q91835F
  • License MIT

Technical analysis library in javascript. Calculates indicators and overlays from ohlcv data

Package Exports

  • ta-math

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ta-math) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Technical analysis math

Travis Packagist PRs Welcome

Tiny library for calculating indicators and overlays from price data in any format. You choose format and data by yourself and library return charts data.

Technical Overlays

  • sma - Simple Moving Average √
  • ema - Exponential Moving Average √
  • bb - Bollinger Band √
  • ebb - Exponential Bollinger Band
  • psar - Parabolic SAR √
  • vbp - Volume by Price √
  • keltner - Keltner Channels
  • zigzag - ZigZag Indicator

Technical Indicators

  • stddev - Standard Deviation √
  • expstd - Exponential Standard Deviation
  • macd - Moving Average Convergence/Divergence √
  • rsi - Relative Strength Index √
  • stoch - Stochastic Oscillator (Full) √
  • obv - On Balance Volume √
  • adl - Accumulation / Distribution line √
  • atr - Average True Range √
  • vi - Vortex Indicator √

Error methods

  • rmsd - Root-Mean-Square Deviation √
  • nrmsd - Normalized Root-Mean-Square Deviation √

Installation

If you use new node.js or modern browsers, you can just install npm package by npm i ta-math or copy ta-math.browser.js script file in web page. With es5 environment you need to think about babel compiler with babel-proxy-plugin.

Usage

You can see how to set new data format in formats.mjs, by default it uses exchangeFromat. Library does not craete new arrays and uses getters through proxy. You can find additional example with bitcoin prices that fetched from ccxt library in source.

  import TA from 'ta-math';
  let ohlcv = [[t0,o0,h0,l0,c0,v0],  ...  ,[tN,oN,hN,lN,cN,vN]];
  let ta = new TA(ohlcv, exchangeFormat);
  let ema_line = ta.ema(15);
  let bband_line = ta.bband(15, 2);

2do list

  • unit tests
  • proxy for ohlcv with different formats
  • generators
  • es5 with babel
  • typescript integration (.d.ts)
  • new indicators
  • good loking ui example

Contributing

Feel free to contribute. Here reference how to implement new indicators. There are test samples in the xls files, you can use this tool to convert columns into rows.