1.0.0 • Published 6 years ago
is-doji v1.0.0
is-doji
Test if a Japanese candlestick qualifies as a doji
Install
npm install is-doji
Use
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
Index
Interfaces
Functions
Functions
isDoji
▸ 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.