uzyn / trading-signals

Technical indicators to run technical analysis with JavaScript / TypeScript.

Home Page:https://www.npmjs.com/package/trading-signals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trading Signals

Language Details Code Coverage License Package Version Dependency Updates

Technical indicators and overlays to run technical analysis with JavaScript / TypeScript.

Motivation

Provide a TypeScript implementation for common technical indicators with arbitrary-precision decimal arithmetic.

Features

  • Accurate. Don't rely on type number and its precision limits. Use Big.
  • Typed. Source code is 100% TypeScript. No need to install external typings.
  • Tested. Code coverage is 100%. No surprises when using it.

Supported Indicators

  1. Average Directional Index (ADX)
  2. Average True Range (ATR)
  3. Bollinger Bands (BB)
  4. Double Exponential Moving Average (DEMA)
  5. Double Moving Average (DMA)
  6. Exponential Moving Average (EMA)
  7. Moving Average Convergence Divergence (MACD)
  8. Rate-of-Change (ROC)
  9. Relative Strength Index (RSI)
  10. Simple Moving Average (SMA)
  11. Smoothed Moving Average (SMMA)

Usage

import {SMA} from 'trading-signals';

const sma = new SMA(3);

// You can add numbers:
sma.update(40);
sma.update(30);
sma.update(20);

// You can add strings:
sma.update('10');

// You can add arbitrary-precision decimals:
import Big from 'big.js';
sma.update(new Big(30));

// You can get the result in various formats:
console.log(sma.getResult().valueOf()); // "20"
console.log(sma.getResult().toFixed(2)); // "20.00"

Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

Maintainers

Benny Neugebauer on Stack Exchange

License

This project is MIT licensed.

Show your support

Give a ⭐️ if this project helped you!

About

Technical indicators to run technical analysis with JavaScript / TypeScript.

https://www.npmjs.com/package/trading-signals

License:MIT License


Languages

Language:TypeScript 100.0%