@ixjb94/indicators v1.2.4

Version Info
A JavaScript Version
There is also a newer version written in JavaScript.
Supports
Browser, ES6, CommonJS, NodeJS, Bun, Svelte, React, Angular, etc.
About
Fastest Technical Indicators written in TypeScript
- Zero Dependencies: @ixjb94/Indicators is built from the ground up to be self-contained, with no external dependencies.
- No Internal Function Calls: Each Method in the library operates independently.
Tests (Jest)
All of the indicators data have been tested with TradingView data and other Libraries.
You can find few in ./tests folder.
(Or you can run: npm test)
Note: All data have been tested with at least last 3 (tail) of TradingView's data.
Data Window: DOGEUSDT-4h-2023-10 (October)
Data Source: Binance Futures ::: Binance Vision
Comparison with TradingView (EMA 10)
Benchmark
Installation
npm install @ixjb94/indicatorsUsage NodeJS
import { Indicators } from "@ixjb94/indicators"
// OR
const { Indicators } = require("@ixjb94/indicators")Usage Browser
index.html example:
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Indicators</title>
</head>
<body>
<!--
PLEASE NOTE: you probably just need one of these
- browser.js
- browser-indicators.js
- browser-indicators-sync.js
- browser-indicators-extract.js
or extracted versions like this:
- ./ema.js | ./sma.js | ./rsi.js
-->
<!-- all versions -->
<script src="./node_modules/@ixjb94/indicators/dist/browser.js"></script>
<!-- indicators -->
<script src="./node_modules/@ixjb94/indicators/dist/browser-indicators.js"></script>
<!-- extracted (not in a class) -->
<script src="./node_modules/@ixjb94/indicators/dist/browser-indicators-extract.js"></script>
<!-- sync indicators -->
<script src="./node_modules/@ixjb94/indicators/dist/browser-indicators-sync.js"></script>
<!-- extracted indicators -->
<script src="./node_modules/@ixjb94/indicators/dist/core/extract/ema.js"></script>
<script src="./node_modules/@ixjb94/indicators/dist/core/extract/sma.js"></script>
<script src="./node_modules/@ixjb94/indicators/dist/core/extract/rsi.js"></script>
<!-- ... -->
<!-- how to use class based -->
<script>
const library = indicators
const ta = new library.Indicators()
ta.ema(close, 20).then(data => console.log(data))
</script>
<!-- how to use extracted versions -->
<script>
const close = [1, 2, 3, 4, 5, 6]
ema(close, 3).then(result => {
console.log(result)
// output: [1, 1.5, 2.25, 3.125, 4.0625, 5.03125]
})
</script>
<!-- how to use extracted version (browser-indicators-extract.js) -->
<script src="./node_modules/@ixjb94/indicators/dist/browser-indicators-extract.js"></script>
<script>
const { ema, sma } = indicators
ema([1,2,3,4,5,6], 3).then(d => console.log(d))
</script>
</body>
</html>Note: you can move files from node_modules to somewhere else you want to like dist, public, etc.
OR you can use unpkg:
https://unpkg.com/@ixjb94/indicators@latest/dist/browser.js
https://unpkg.com/@ixjb94/indicators@latest/dist/browser-indicators.js
https://unpkg.com/@ixjb94/indicators@latest/dist/browser-indicators-sync.js
https://unpkg.com/@ixjb94/indicators@latest/dist/browser-indicators-extract.js
OR
https://unpkg.com/@ixjb94/indicators@latest/dist/core/extract/ema.js
https://unpkg.com/@ixjb94/indicators@latest/dist/core/extract/sma.js
https://unpkg.com/@ixjb94/indicators@latest/dist/core/extract/rsi.js
// ... and others
see the full list:
https://unpkg.com/browse/@ixjb94/indicators@1.2.3/dist/core/extract/Indicators Consists Of
Indicators consists of these classes:
1- Indicators: new Indicators()
2- IndicatorsSync: new IndicatorsSync()
3- Or you can use then directly without using classes
Examples
Note: Everything isPromised so you need to do .then or await
unless you use Sync versions.
let ta = new Indicators()
ta.sma(close, 20)
ta.rsi(close, 14)Types & Intellisense & Browser Support

Indicators
ā
= Available and fastest
ā = Indicator is not available
š = Developing...
Compared to:
node-talib, tulipnode, technicalindicators, pandas_ta
| Identifier | Indicator Name | @ixjb94/indicators |
|---|---|---|
| ad | Accumulation/Distribution Line | ā |
| adosc | Accumulation/Distribution Oscillator | ā |
| adx | Average Directional Movement Index | ā |
| adxr | Average Directional Movement Rating | ā |
| ao | Awesome Oscillator | ā |
| apo | Absolute Price Oscillator | ā |
| aroon | Aroon | ā |
| aroonosc | Aroon Oscillator | ā |
| atr | Average True Range | ā |
| avgprice | Average Price | ā |
| bbands | Bollinger Bands | ā |
| bop | Balance of Power | ā |
| cci | Commodity Channel Index | ā |
| cmo | Chande Momentum Oscillator | ā |
| crossany | Crossany | ā |
| crossover | Crossover | ā |
| crossunder | Crossunder | ā |
| crossOverNumber | Crossover a number | ā |
| crossUnderNumber | Crossunder a number | ā |
| cvi | Chaikins Volatility | ā |
| decay | Linear Decay | ā |
| dema | Double Exponential Moving Average | ā |
| di | Directional Indicator | ā |
| dm | Directional Movement | ā |
| dpo | Detrended Price Oscillator | ā |
| dx | Directional Movement Index | ā |
| edecay | Exponential Decay | ā |
| ema | Exponential Moving Average | ā |
| emv | Ease of Movement | ā |
| fisher | Fisher Transform | ā |
| fosc | Forecast Oscillator | ā |
| hma | Hull Moving Average | ā |
| kama | Kaufman Adaptive Moving Average | ā |
| kvo | Klinger Volume Oscillator | ā |
| lag | Lag | ā |
| linreg | Linear Regression | ā |
| linregintercept | Linear Regression Intercept | ā |
| linregslope | Linear Regression Slope | ā |
| macd | Moving Average Convergence/Divergence | ā |
| marketfi | Market Facilitation Index | ā |
| mass | Mass Index | ā |
| max | Maximum In Period | ā |
| md | Mean Deviation Over Period | ā |
| medprice | Median Price | ā |
| mfi | Money Flow Index | ā |
| min | Minimum In Period | ā |
| mom | Momentum | ā |
| natr | Normalized Average True Range | ā |
| nvi | Negative Volume Index | ā |
| obv | On Balance Volume | ā |
| ppo | Percentage Price Oscillator | ā |
| psar | Parabolic SAR | ā |
| pvi | Positive Volume Index | ā |
| qstick | Qstick | ā |
| roc | Rate of Change | ā |
| rocr | Rate of Change Ratio | ā |
| rsi | Relative Strength Index | ā |
| sma | Simple Moving Average | ā |
| stddev | Standard Deviation Over Period | ā |
| stderr | Standard Error Over Period | ā |
| stoch | Stochastic Oscillator | ā |
| stochrsi | Stochastic RSI | ā |
| sum | Sum Over Period | ā |
| tema | Triple Exponential Moving Average | ā |
| tr | True Range | ā |
| trima | Triangular Moving Average | ā |
| trix | Trix | ā |
| tsf | Time Series Forecast | ā |
| typprice | Typical Price | ā |
| ultosc | Ultimate Oscillator | ā |
| var | Variance Over Period | ā |
| vhf | Vertical Horizontal Filter | ā |
| vidya | Variable Index Dynamic Average | ā |
| volatility | Annualized Historical Volatility | ā |
| vosc | Volume Oscillator | ā |
| vwma | Volume Weighted Moving Average | ā |
| wad | Williams Accumulation/Distribution | ā |
| wcprice | Weighted Close Price | ā |
| wilders | Wilders Smoothing | ā |
| willr | Williams %R | ā |
| wma | Weighted Moving Average | ā |
| zlema | Zero-Lag Exponential Moving Average | ā |
| abands | ā | |
| alma | Arnaud Legoux Moving Average | ā |
| ce | Chandelier Exit | ā |
| cmf | Chaikin money flow | ā |
| copp | Coppock Curve | ā |
| dc | Donchian Channels | ā š |
| fi | Force index | ā |
| ikhts | ā | |
| kc | Keltner Channels | ā |
| kst | Know Sure Thing | ā |
| mama | MESA Adaptive Moving Average | ā |
| pbands | ā | |
| pc | ā | |
| pfe | Polarized Fractal Efficiency | ā |
| posc | ā | |
| rmi | Relative Momentum Index | ā |
| rmta | Recursive Moving Trend Average | ā |
| rvi | Relative Vigor Index | ā |
| smi | Stochastic Momentum Index | ā |
| tsi | True Strength Index | ā |
| vwap | Volume-Weighted Average Price | ā |
Icon by
https://www.flaticon.com/free-icon/bar-graph_3501061
Author: Freepik
Website: https://www.freepik.com
https://www.flaticon.com/authors/freepik1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago