Open julianzero opened 1 year ago
yeah, I have noticed that issue for quite a long time.
The issue here is tha there is not a strict rule about how to implement a env or a DRL agent, so it will be super confusing to know where to begin using this project. You can use SB3, I think it's correct at this moment.
I would like to fix the "tutorial is incorrect" you mentioned. Could you please put the link to the code that might be wrong in this issue?
the three arrays should be different for training and testing.
I also agree with you on this - during the training phase as well as the testing phase , env should load arrays for different time periods
So the parameters start_date=TEST_START_DATE
and end_date=TEST_END_DATE
are passed into the function test()
:
Then we fetch the data from TEST_START_DATE
to TEST_END_DATE
:
And we build the env_instance
:
Finally, the env_instance
for testing is passed into the function DRLAgent_erl.DRL_prediction()
The policy network maps state to action in:
env_config = { "price_array": price_array, "tech_array": tech_array, "turbulence_array": turbulence_array, "if_train": False, } env_instance = env(config=env_config)
if drl_lib == "elegantrl": from finrl.agents.elegantrl.models import DRLAgent as DRLAgent_erl episode_total_assets = DRLAgent_erl.DRL_prediction( model_name=model_name, cwd=cwd, net_dimension=net_dimension, environment=env_instance, )
The three arrays passed into training and testing/prediction functions must be different three arrays, three arrays for training and three other ones for testing or prediction... It will take quite significant effort to rewrite this part.
Good luck!
Hi everyone,
After going through the code carefully, with ElegantRL, I believe it is necessary to reconstruct a new env for testing/trading after training with an old env.
Training via Elegantrl demands a price array, a tech array, and an turbulence array, three arrays as inputs, while testing/trading demands an instance of env, which already includes env configs that contains the three arrays above. So I believe the three arrays should be different for training and testing.
The tutorial is incorrect! Please confirm or comment if you happen to read this post!
Thanx.