1.2.4 • Published 10 months ago

@ixjb94/indicators v1.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

CodeFactor npm version npm size npm downloads last commit

logo

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
Tests

Comparison with TradingView (EMA 10)

Indicators Data Test

Benchmark

See full Benchmark info

Installation

npm install @ixjb94/indicators

Usage 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

types browser

Indicators

āœ… = Available and fastest
āŒ = Indicator is not available
šŸ”„ = Developing...
Compared to:
node-talib, tulipnode, technicalindicators, pandas_ta

IdentifierIndicator Name@ixjb94/indicators
adAccumulation/Distribution Lineāœ…
adoscAccumulation/Distribution Oscillatorāœ…
adxAverage Directional Movement Indexāœ…
adxrAverage Directional Movement Ratingāœ…
aoAwesome Oscillatorāœ…
apoAbsolute Price Oscillatorāœ…
aroonAroonāœ…
aroonoscAroon Oscillatorāœ…
atrAverage True Rangeāœ…
avgpriceAverage Priceāœ…
bbandsBollinger Bandsāœ…
bopBalance of Powerāœ…
cciCommodity Channel Indexāœ…
cmoChande Momentum Oscillatorāœ…
crossanyCrossanyāœ…
crossoverCrossoverāœ…
crossunderCrossunderāœ…
crossOverNumberCrossover a numberāœ…
crossUnderNumberCrossunder a numberāœ…
cviChaikins Volatilityāœ…
decayLinear Decayāœ…
demaDouble Exponential Moving Averageāœ…
diDirectional Indicatorāœ…
dmDirectional Movementāœ…
dpoDetrended Price Oscillatorāœ…
dxDirectional Movement Indexāœ…
edecayExponential Decayāœ…
emaExponential Moving Averageāœ…
emvEase of Movementāœ…
fisherFisher Transformāœ…
foscForecast Oscillatorāœ…
hmaHull Moving Averageāœ…
kamaKaufman Adaptive Moving Averageāœ…
kvoKlinger Volume Oscillatorāœ…
lagLagāœ…
linregLinear Regressionāœ…
linreginterceptLinear Regression Interceptāœ…
linregslopeLinear Regression Slopeāœ…
macdMoving Average Convergence/Divergenceāœ…
marketfiMarket Facilitation Indexāœ…
massMass Indexāœ…
maxMaximum In Periodāœ…
mdMean Deviation Over Periodāœ…
medpriceMedian Priceāœ…
mfiMoney Flow Indexāœ…
minMinimum In Periodāœ…
momMomentumāœ…
natrNormalized Average True Rangeāœ…
nviNegative Volume Indexāœ…
obvOn Balance Volumeāœ…
ppoPercentage Price Oscillatorāœ…
psarParabolic SARāœ…
pviPositive Volume Indexāœ…
qstickQstickāœ…
rocRate of Changeāœ…
rocrRate of Change Ratioāœ…
rsiRelative Strength Indexāœ…
smaSimple Moving Averageāœ…
stddevStandard Deviation Over Periodāœ…
stderrStandard Error Over Periodāœ…
stochStochastic Oscillatorāœ…
stochrsiStochastic RSIāœ…
sumSum Over Periodāœ…
temaTriple Exponential Moving Averageāœ…
trTrue Rangeāœ…
trimaTriangular Moving Averageāœ…
trixTrixāœ…
tsfTime Series Forecastāœ…
typpriceTypical Priceāœ…
ultoscUltimate Oscillatorāœ…
varVariance Over Periodāœ…
vhfVertical Horizontal Filterāœ…
vidyaVariable Index Dynamic Averageāœ…
volatilityAnnualized Historical Volatilityāœ…
voscVolume Oscillatorāœ…
vwmaVolume Weighted Moving Averageāœ…
wadWilliams Accumulation/Distributionāœ…
wcpriceWeighted Close Priceāœ…
wildersWilders Smoothingāœ…
willrWilliams %Rāœ…
wmaWeighted Moving Averageāœ…
zlemaZero-Lag Exponential Moving Averageāœ…
abandsāœ…
almaArnaud Legoux Moving Averageāœ…
ceChandelier Exitāœ…
cmfChaikin money flowāœ…
coppCoppock CurveāŒ
dcDonchian Channelsāœ…šŸ”„
fiForce indexāœ…
ikhtsāŒ
kcKeltner Channelsāœ…
kstKnow Sure Thingāœ…
mamaMESA Adaptive Moving AverageāŒ
pbandsāœ…
pcāŒ
pfePolarized Fractal Efficiencyāœ…
poscāœ…
rmiRelative Momentum Indexāœ…
rmtaRecursive Moving Trend Averageāœ…
rviRelative Vigor Indexāœ…
smiStochastic Momentum Indexāœ…
tsiTrue Strength Indexāœ…
vwapVolume-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/freepik
1.2.4

10 months ago

1.2.3

11 months ago

1.2.2

1 year ago

1.2.1

1 year ago

1.1.34

1 year ago

1.1.33

1 year ago

1.1.37

1 year ago

1.1.36

1 year ago

1.1.29

2 years ago

1.1.30

2 years ago

1.1.31

2 years ago

1.1.23

2 years ago

1.1.26

2 years ago

1.1.25

2 years ago

1.1.24

2 years ago

1.1.22

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.17

2 years ago

1.0.19

2 years ago

1.1.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.2

2 years ago

1.1.12

2 years ago

1.0.22

2 years ago

1.1.11

2 years ago

1.0.21

2 years ago

1.1.10

2 years ago

1.0.20

2 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago