Socket
Socket
Sign inDemoInstall

bitmex-candle-to-record

Package Overview
Dependencies
5
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bitmex-candle-to-record

Map a BitMEX Candle to a talib Record


Version published
Weekly downloads
10
increased by25%
Maintainers
1
Install size
317 kB
Created
Weekly downloads
 

Readme

Source

bitmex-candle-to-record Build status npm version codecov

Map a BitMEX Candle to a talib Record

Install

npm install bitmex-candle-to-record

Use

import bitmexCandleToRecord from 'bitmex-candle-to-record'
import Record from 'timeseries-record'

import { BitmexAPI } from 'bitmex-node'
const bitmex = new BitmexAPI()

(async () => {
    const quotes = await bitmex.Trade.getBucketed({
        binSize: '1d',
        partial: false,
        symbol: 'XBTUSD',
        reverse: true
    })
    const records: Record[] = quotes.map(q => bitmexCandleToRecord(q, '1d'))
}) ()

Notes

BitMEX stores the time of the candle close in the timestamp field as opposed to the candle open (that most exchanges use). To convert this representation of a candle to a Record this API subtracts the length of the session from each timestamp, so the apparent time of a Record will not match its associated Candle.

Keywords

FAQs

Last updated on 24 Dec 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc