Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using future data #6

Open
Amitdutta121 opened this issue Dec 14, 2019 · 3 comments
Open

Using future data #6

Amitdutta121 opened this issue Dec 14, 2019 · 3 comments

Comments

@Amitdutta121
Copy link

I think you are using future data as an Observation and reinforcement learning is using that data to make profit that's why it's fitting the stock market line.
I think rather using
self.df.loc[self.current_step: self.current_step + 5, 'Open'].values / MAX_SHARE_PRICE,
this, you should use this
self.df.loc[self.current_step - 5: self.current_step, 'Open'].values / MAX_SHARE_PRICE,

correct me if I am wrong.

@LucCADORET
Copy link

I also had the same thought.

Furthermore, I was wondering why the current step is not included in the observations. Maybe because we're using the 'open' values rather than the 'close' ones ? (I prefer working with close, since I can say that the current candle is a completed one).

@Forsworns
Copy link

Forsworns commented Feb 6, 2020

I can't agree with you more, it may be a mistake to use the price in the future to predict the future price XD.

And yeah, @LucCADORET , you can use the current step because the self.df.loc[self.current_step - 5: self.current_step, 'Open'].values / MAX_SHARE_PRICE already contains the current_step. (It's a 6x6 matrix in pandas, not 5x5 in numpy, maybe you neglect this...)

I think that it's up to you to choose which known statistics as long as you can make profit :).

And once we use self.df.loc[self.current_step - 5: self.current_step, 'Open'].values / MAX_SHARE_PRICE, the code

if self.current_step > len(self.df.loc[:, 'Open'].values) - 6:
            self.current_step = 0

should be replaced by

if self.current_step < 6:
            self.current_step = 6

As for the 'open/close' values, I don't know which one should be considered. But in the repository "Stock-Prediction-Models", they use the close value. And that repo contains plenty of trading agents/algorithms, which may be helpful since this repo seems to be archived...

@LucCADORET
Copy link

I didn't look carefully enough, it's "loc" and not "iloc" which includes also the end index (iloc doesn't) so I thought last step was not included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants