1.0.0 • Published 6 years ago

is-doji v1.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

is-doji Build Status npm npm version

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:

NameTypeDefault valueDescription
candleCandle-
Default value maximumBodyAsPercentOfSpreadnumber8Largest body:spread ratio to qualify as a doji.

Returns: boolean True if candle is a doji.