npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

binary-indicators

v1.5.2

Published

Binary.com Indicators

Downloads

67

Readme

#Binary.com Indicators

Build Status Coverage Status Code Climate

Install by running:

npm install binary-indicators --save

Simple Moving Average

A simple moving average (SMA) is an arithmetic moving average calculated by adding the closing price of the security for a number of time periods and then dividing this total by the number of time periods.

Calculate a single value, from array of numbers:

Input array of numbers:

const data = [1, 10, 100, 1000, 10000];
const result = simpleMovingAverage(data, { periods: 3 });

Calculate a single value from array of candles:

const data = [
    { close: 1 },
    { close: 2 },
    { close: 3 },
];
const result = simpleMovingAverage(data, { periods: 3, field: 'close' });

Calculate an array of values from array of numbers:

const data = [1, 2, 3, ...];
const result = simpleMovingAverageArray(data, { periods: 10 });

Exponential Moving Average (EMA)

The 12- and 26-day EMAs are the most popular short-term averages, and they are used to create indicators like the moving average convergence divergence (MACD) and the percentage price oscillator (PPO). In general, the 50- and 200-day EMAs are used as signals of long-term trends.

Bollinger Band (BB)

Bollinger Bands® are volatility bands placed above and below a moving average. Volatility is based on the standard deviation, which changes as volatility increases and decreases. The bands automatically widen when volatility increases and narrow when volatility decreases.

Calculate a single value, from array of numbers:

Input array of numbers:

const data = [1, 10, 100, 1000, 10000];
const result = bollingerBands(data, { periods: 3 });

Returned value is an array of three items:

[middleValue, upperValue, lowerValue]

Calculate a single value from array of candles:

const data = [
    { close: 1 },
    { close: 2 },
    { close: 3 },
];
const result = bollingerBands(data, { periods: 3, field: 'close' });

Calculate an array of values from array of numbers:

const data = [1, 2, 3, ...];
const result = bollingerBandsArray(data, { periods: 10 });

Relative Strength Index (RSI)

Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. RSI oscillates between zero and 100.

Moving Average Convergence Divergence (MACD)

Moving average convergence divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of prices. The MACD is calculated by subtracting the 26-day exponential moving average (EMA) from the 12-day EMA. A nine-day EMA of the MACD, called the "signal line", is then plotted on top of the MACD, functioning as a trigger for buy and sell signals.

Momentum

Momentum is the rate of acceleration of a security's price or volume. In technical analysis, momentum is considered an oscillator and is used to help identify trend lines.

Alligator

The Alligator indicator uses three smoothed moving averages, set at five, eight, and 13 periods, which are all Fibonacci numbers. The initial smoothed average is calculated with a simple moving average (SMA), adding additional smoothed averages that slow down indicator turns.

Stochastic Oscillator

Momentum indicator comparing the closing price of a security to the range of its prices over a certain period of time. The sensitivity of the oscillator to market movements is reducible by adjusting that time period or by taking a moving average of the result.