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

@debut/indicators

v1.3.22

Published

Implementation of most popular technical stock indicators for debut environment

Downloads

3,658

Readme

npm npm NPM

Streaming Technical Indicators

High performance for you trading application

The main feature of these indicators is their continuous operation, which means that you can use them both for real trading and for teaching trading strategies on history, since this is a passage from the beginning to the end of the stream of candles. This approach allows you to reduce the number of necessary calculations by tens of times and is the most optimal in terms of performance.

Features

  • High performance
  • Easy to use with candles streaming
  • Minimal state for calculation
  • Moment value (possible to calculate every tick)
  • Typescript
  • Unit Tested / Cross SDK Validated

Available Indicators

Candles

  • Heiken Ashi.

Utils

  • Standard Deviation (SD).
  • Correlation.
  • Circullar buffer. This is simple streaming array for pop and push (performance optimized).
  • Sampler. This is sample creator, for indicators like SMA, for easy getting SMA(SMA(SMA(SMA())) some sampled x-times values.
  • UniLevel. Dynamic levels for single number value 0 balanced (values between -N and +N).

Next value (indicator.nextValue)

This method allows you to get the current value of the indicator, usually performed according to the data of a closed candle. The method call affects all subsequent calculations of the indicator readings.

Moment value (indicator.momentValue)

The method of calculating the instantaneous value of the indicator allows you to obtain information about the indicator readings in real time, without affecting future readings. This allows you to work with the indicator inside the candle.

Download

Releases are available under Node Package Manager (npm):

npm install @debut/indicators

Example with Simple Moving Average

import { SMA } from '@debut/indicators';
const sma = new SMA(4); // Create SMA with 4 period

// SMA workflow
//=> [ '2.50', '3.50', '4.50', '5.50', '6.50', '7.50' ]
//=>   │       │       │       │       │       └─(6+7+8+9)/4
//=>   │       │       │       │       └─(5+6+7+8)/4
//=>   │       │       │       └─(4+5+6+7)/4
//=>   │       │       └─(3+4+5+6)/4
//=>   │       └─(2+3+4+5)/4
//=>   └─(1+2+3+4)/4

sma.nextValue(1); // undefined
sma.nextValue(2); // undefined
sma.nextValue(3); // undefined
sma.nextValue(4); // 2.50
sma.nextValue(5); // 3.50
sma.nextValue(6); // 4.50
sma.nextValue(7); // 5.50
sma.momentValue(8); // 6.50
sma.nextValue(8); // 6.50
sma.momentValue(9); // 7.50
sma.nextValue(9); // 7.50

Extra custom indicators

  • MOVE (direction move with power no less than p)
  • WAVE (directional move with bearish or bullish candle series and power p)

Benchmarks

Apple M1 Pro, Node v16.14.0. Tested on dateset with 100k elements.

| Indicator name | @debut/indicators (ops/sec)|technicalindicators (ops/sec)|indicatorts (ops/sec)| |:---------------:|:---------------:|:---------------:|:---------------:| |AwesomeOscillator|318|23|158| |ADX|358|42|x| |ATR|613|136|95| |Bollinger Bands|347|9|219| |CCI|151|12|158| |DC|474|x|74| |PSAR|1,453|278|666| |EMA|1,720|452|1,537| |MACD|1,417|90|467| |ROC|3,625|64|x| |RSI|1,239|38|315| |SMA|678|65|645| |WEMA|1,462|455|x| |WMA|287|41|x| |Stochastic|340|25|67|

Benchmarks results is autogenerated by https://github.com/coin-unknown/indicators-benchmark