notadamking / RLTrader

A cryptocurrency trading environment using deep reinforcement learning and OpenAI's gym
https://discord.gg/ZZ7BGWh
GNU General Public License v3.0
1.71k stars 537 forks source link

Date Format Issue with Data Providers. #97

Open mwbrulhardt opened 5 years ago

mwbrulhardt commented 5 years ago

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) `