JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q60506F
  • License MIT

Trade Indicators

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

  • Double Exponential Moving Average (dema)
  • Exponential Moving Average (ema)
  • 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);