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

unable to render a correct graph #61

Closed krowll closed 5 years ago

krowll commented 5 years ago

Hi!

After changing the sorting in optimize, train and test (df['Date'] = pd.to_datetime(df['Date'], format='%Y-%m-%d %I-%p')), I'm unable to render a correct graph.

image

In BitcoinTradingGraph.py I've changed the lines to

def __init__(self, df):
    self.df = df
    # self.df['Time'] = self.df['Date'].apply(
    #     lambda x: datetime.strptime(x, '%Y-%m-%d %I-%p'))
    self.df['Time'] = self.df['Date']
    self.df = self.df.sort_values('Time')

I've compared the dataframe with the original code and the new one and I can't find any difference. Nonetheless, I'm unable to render a correct graph.

Am I missing something here?

notadamking commented 5 years ago

This is due to #28