@strong-roots-capital/to-bitmex-timeframe
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

to-bitmex-timeframe Build status npm version codecov

Convert a TradingView timeframe to a BitMEX timeframe

Install

npm install @strong-roots-capital/to-bitmex-timeframe

Use

import toBitmexTimeframe from '@strong-roots-capital/to-bitmex-timeframe'

toBitmexTimeframe('1')
//=> '1m'

toBitmexTimeframe('5')
//=> '5m'

toBitmexTimeframe('1H')
//=> '1h'

toBitmexTimeframe('1D')
//=> '1d'

toBitmextimeframe('1W')
//=> { ArgumentError: Expected string to be one of `["1","5","1H","1D"]`, got `1W` }

Note: for convenience in conjunction with bitmex-node, the type of return type is '1m' | '5m' | '1h' | '1d'.

Related

Package Sidebar

Install

npm i @strong-roots-capital/to-bitmex-timeframe

Weekly Downloads

6

Version

1.0.6

License

ISC

Unpacked Size

5.03 kB

Total Files

4

Last publish

Collaborators

  • amchelle
  • hamroctopus