There is also a newer version written in JavaScript.
Browser, ES6, CommonJS, NodeJS, Bun, Svelte, React, Angular, etc.
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.
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
npm install @ixjb94/indicators
import { Indicators } from "@ixjb94/indicators"
// OR
const { Indicators } = require("@ixjb94/indicators")
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 these classes:
1- Indicators: new Indicators()
2- IndicatorsSync: new IndicatorsSync()
3- Or you can use then directly without using classes
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)
β
= 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 | β |
https://www.flaticon.com/free-icon/bar-graph_3501061
Author: Freepik
Website: https://www.freepik.com
https://www.flaticon.com/authors/freepik