to-bitmex-timeframe
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'
.