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

ForwardTest class #44

Closed
einarbmag opened this issue Jan 14, 2018 · 6 comments
Closed

ForwardTest class #44

einarbmag opened this issue Jan 14, 2018 · 6 comments

Comments

@einarbmag
Copy link

einarbmag commented Jan 14, 2018

Hi, thank you for your excellent work, this is very interesting stuff.

I am eager to test this on the live market, but having trouble moving from backtesting to forwardtesting. Any chance that an update with a ForwardTest class is on the way, or that you could advise on how to implement it? I understand it roughly, i.e. the generate_history_matrix( ) function needs to update the datamatrix with the newest market data (with "online" = True in the config file), and return that. And the trade_by_strategy( ) clearly needs a slight rewriting compared to BackTest as we don't know the future price. Any help on how to correctly return the newest market data would be appreciated.

@dexhunter
Copy link
Collaborator

possible related to this comment

@gittaylor
Copy link

gittaylor commented Jan 15, 2018

Yes, I am having the same problem. I was able to modify the Backtest class to get new data, but tflearn will not accept the new history for training. Any help would be appreciated.

@redzhepdx
Copy link

In backtesting there are two options to test model online or offline.

Online : Takes data from poloniex and updates database
Offline : Using pre-collected datas in Data.db

Backtesting module using rollingtrainer's datamatrix and it takes all datas from database at the begginning of the backtest.

But I couldn't find a way to get new data and process it .
It is using day based date to take data in given day based interval.
Is there any module to update database dynamically for livetrading without resetting learning of the model ?

@ZhengyaoJiang
Copy link
Owner

Is there any module to update database dynamically for livetrading without resetting learning of the model ?

A simple(while not elegant) method is to append new data to the global_data (Panel in the memory) and modify all the related indexes.

@redzhepdx
Copy link

I am doing this for real time data ;

  • last input X: global_data[: , :, -window_size:]
  • apply action according to X
  • Wait n-minutes
  • get input again
  • y : newX[:, :, -1] / newX[:, :, -2]
    But couldn't solve the how to use thid x, y data to update RL agent.
    I think RL training must be always active for the understand every new situation , but it seems it don't train model in backtesting part adding None object to experience tracker module.
    Also thank you for first fast reply :)

@einarbmag
Copy link
Author

Thank you for the hints @ZhengyaoJiang and @redzhepdx, will give it another go now!

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

5 participants