Package Exports
- @ldrick/trade-indicators
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 (@ldrick/trade-indicators) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
trade-indicators
Trade Indicators written in Typescript
- Average Directional Index (adx)
- Average True Range (atr)
- Double Exponential Moving Average (dema)
- Exponential Moving Average (ema)
- Positive Directional Index (pdi)
- Negative Directional Index (mdi)
- Simple Moving Average (sma)
- Smoothed Moving Average (smma)
- Triple Exponential Moving Average (tema)
- Weighted Moving Average (wma)
Install
npm install @ldrick/trade-indicators
or yarn add @ldrick/trade-indicators
Usage
In JavaScript:
const { dema, ema, sma, smma, tema, wma } = require('@ldrick/trade-indicators');
const prices = [3, 2.1, 3, 4, 5.3, 5, 4.8, 6, 7, 5];
const period = 3;
dema(prices, period);
ema(prices, period);
sma(prices, period);
smma(prices, period);
tema(prices, period);
wma(prices, period);
In TypeScript:
import { dema, ema, sma, smma, tema, wma } from '@ldrick/trade-indicators';
const prices = [3, 2.1, 3, 4, 5.3, 5, 4.8, 6, 7, 5];
const period = 3;
dema(prices, period);
ema(prices, period);
sma(prices, period);
smma(prices, period);
tema(prices, period);
wma(prices, period);