Open formidiable opened 2 years ago
Remove EPS and n_actions from the DeepRL constructor, because they don't match the parameteres of the constructor of DeepRL, and also set data_train to the correct type it should be DataAutoPatternExtractionAgent and not DataForPatternBasedAgent. And likewise for the test() method, the parametres used doesn't match the constructor of the test()-method.
Like this:
` deepRLAgent = DeepRL(data_loader, dataTrain_autoPatternExtractionAgent_windowed, dataTest_autoPatternExtractionAgent_windowed, DATASET_NAME, state_mode, window_size, transaction_cost, BATCH_SIZE=BATCH_SIZE, GAMMA=GAMMA, ReplayMemorySize=ReplayMemorySize, TARGET_UPDATE=TARGET_UPDATE, n_step=n_step)
deepRLAgent.train(n_episodes) file_name = None
ev_deepRLAgent = deepRLAgent.test( initial_investment=initial_investment, test_type='train')
deepRLAgent_portfolio_train = ev_deepRLAgent.get_daily_portfolio_value() ev_deepRLAgent = deepRLAgent.test( initial_investment=initial_investment, test_type='test')
deepRLAgent_portfolio_test = ev_deepRLAgent.get_daily_portfolio_value()
model_kind = 'DQN-pattern'
add_train_portfo(model_kind, deepRLAgent_portfolio_train) add_test_portfo(model_kind, deepRLAgent_portfolio_test) ``
Hello Thank you for reaching out
I have changed the code a little bit. So the main file to run would be main.py instead of main.ipynb. Also, try to set the transaction cost to zero. It hasn't been fully tested
On Sat, Dec 25, 2021 at 5:29 PM formidiable @.***> wrote: