Heikinashi

Converts OHLC Candlestick data to Heikin-Ashi
The conversion is done based on this:
HA.Close = (Open(0) + High(0) + Low(0) + Close(0)) / 4;
HA.Open = (HA.Open(-1) + HA.Close(-1)) / 2;
HA.High = MAX(High(0), HA.Open(0), HA.Close(0));
HA.Low = Min(Low(0), HA - Open(0), HA.Close(0));
The output is an array of the same size
let result = [{
open: 100,
high: 200,
low: 10,
close: 50,
}, ...
]
Install
npm i -S heikinashi
Usage
var HeikinAshi = require("heikinashi");
let result = HeikinAshi([
{
time: 1525651200,
close: 9377.81,
high: 9662.23,
low: 9202.13,
open: 9643.99,
volume: 73842.44,
},
...
],
options{
overWrite: false,
formatNumbers: false,
decimals: 4,
forceExactDecimals: false
});
console.log("result: ", JSON.stringify(result, null, 2));
Examples:
This package is used to implement TD Sequential indicator in Bitcoin CrazYness app:
BitcoinCrazYness.com
Below is an example screenshot.
Standard | Heikin Ashi |
---|
 |  |
License
MIT