A Javascript implementation of the technical indicator Ichimoku Kinko Hyo.
It calculates:
- Tenkan-sen (ConversionLine): (9-period high + 9-period low)/2))
- Kijun-sen (Base Line): (26-period high + 26-period low)/2))
- Senkou Span A (Leading Span A): (Conversion Line + Base Line)/2))
- Senkou Span B (Leading Span B): (52-period high + 52-period low)/2))
npm install ichimoku
const ichimoku = new Ichimoku({
conversionPeriod : 9,
basePeriod : 26,
spanPeriod : 52,
displacement : 26,
values : []
})
for( let candle of candles ) {
let ichimokuValue = ichimoku.nextValue({
high : candle.high,
low : candle.low,
close : candle.close
})
}
{
"conversion" : 1.33956,
"base" : 1.33723,
"spanA" : 1.33791,
"spanB" : 1.33735
}