Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

candlesticks

kaelzhang74MIT1.3.0

The thing to manage stock candlesticks

candlesticks, candlestick, fintech, stock, bullish, bearish

readme

Build Status Coverage

candlesticks

The thing to manage candlesticks.

Install

$ npm install candlesticks

Usage

import {
  Candlesticks,
  Candlestick
} from 'candlesticks'

const candlesticks = new Candlesticks({
  // Determine whether the candlestick is closed
  closed (time: Date): Boolean {
    // ...
  },
  transform (datum: RawDatum): ArrayDatum {

  }
})

struct ArrayDatum

[
  open,   // Number
  high,   // Number
  low,    // Number
  close,  // Number
  volume, // Number
  time    // Date
]

struct ObjectDatum

{
  open,   // Number
  high,   // Number
  low,    // Number
  close,  // Number
  volume, // Number
  time    // Date
}

class: Candlesticks(options)

Candlesticks.from(data: Array<ObjectDatum | ArrayDatum | Candlestick>)

candlesticks.update(...data)

  • data Array.<RawDatum>

candlesticks.open

Returns Array.<Number> open prices

candlesticks.high

Returns Array.<Number>

candlesticks.low

Returns Array.<Number>

candlesticks.close

Returns Array.<Number>

candlesticks.volume

Returns Array.<Number>

candlesticks.time

Returns Array.<Date>

class: Candlestick(...ArrayDatum)

Candlestick.from(datum: ObjectDatum | ArrayDatum | Candlestick)

License

MIT

changelog

History