candlesticks
v1.3.0
Published
The thing to manage stock candlesticks
Downloads
46
Maintainers
Readme
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