Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kaelzhang/node-candlesticks

The thing to manage candlesticks
https://github.com/kaelzhang/node-candlesticks

candlestick fintech stock

Last synced: 17 days ago
JSON representation

The thing to manage candlesticks

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/kaelzhang/node-candlesticks.svg?branch=master)](https://travis-ci.org/kaelzhang/node-candlesticks)
[![Coverage](https://codecov.io/gh/kaelzhang/node-candlesticks/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/node-candlesticks)

# candlesticks

The thing to manage candlesticks.

## Install

```sh
$ npm install candlesticks
```

## Usage

```js
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`

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

### struct `ObjectDatum`

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

## class: Candlesticks(options)

### Candlesticks.from(data: Array)

### candlesticks.update(...data)

- **data** `Array.`

### candlesticks.open

Returns `Array.` open prices

### candlesticks.high

Returns `Array.`

### candlesticks.low

Returns `Array.`

### candlesticks.close

Returns `Array.`

### candlesticks.volume

Returns `Array.`

### candlesticks.time

Returns `Array.`

## class: Candlestick(...ArrayDatum)

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

## License

MIT