Skip to content
This repository has been archived by the owner on Dec 30, 2023. It is now read-only.

strong-roots-capital/to-bitmex-timeframe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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