RLTrader
RLTrader copied to clipboard
Date Format Issue with Data Providers.
When trying to use the ExchangeDataProvider class, there is an exception when trying to use the next_ohlcv method. The issue is with giving the "since" parameter a string for the datetime. Instead of a string it wants the timestamp of that date passed as an integer. This code produces an HTTPError. ` import dateutil.parser
dp = ExchangeDataProvider()
since = '2018-01-01T00:00:00Z'
dp.exchange.fetchOHLCV(symbol=dp.symbol_pair, timeframe=dp.time_frame,
since=since, limit=1)
This code executes fine.
import dateutil.parser
dp = ExchangeDataProvider()
since = int(dateutil.parser.parse('2018-01-01T00:00:00Z').timestamp()) dp.exchange.fetchOHLCV(symbol=dp.symbol_pair, timeframe=dp.time_frame, since=since, limit=1) `