is-doji
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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:

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.


Package Sidebar

Install

npm i is-doji

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

17.4 kB

Total Files

10

Last publish

Collaborators

  • hamroctopus