Test if a Japanese candlestick qualifies as a doji
npm install is-doji
import { isDoji, Candle } from '../src/is-doji'
const dojiCandle: Candle = {
open: 0,
high: 100,
low: 0,
close: 8
}
const nonDojiCandle: Candle = {
open: 0,
high: 100,
low: 0,
close: 100
}
console.log(isDoji(dojiCandle))
//=> true
console.log(isDoji(nonDojiCandle))
//=> false
โธ isDoji(candle: Candle, maximumBodyAsPercentOfSpread?: number
): boolean
Defined in is-doji.ts:25
Returns true if candle qualifies as a doji.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
candle | Candle | - | |
Default value maximumBodyAsPercentOfSpread |
number |
8 | Largest body:spread ratio to qualify as a doji. |
Returns: boolean
True if candle is a doji.