MehranTaghian / DQN-Trading

A Deep Reinforcement Learning Framework for Stock Market Trading
MIT License
139 stars 48 forks source link

__init__() got an unexpected keyword argument 'EPS' #1

Open formidiable opened 2 years ago

MehranTaghian commented 2 years ago

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:


TypeError Traceback (most recent call last) in 1 hidden_size = 64 2 ----> 3 gru_agent = gru(data_loader, dataTrain_sequential, dataTest_sequential, DATASET_NAME, transaction_cost, hidden_size, 4 BATCH_SIZE=BATCH_SIZE, GAMMA=GAMMA, EPS=EPS, 5 ReplayMemorySize=ReplayMemorySize,

TypeError: init() got an unexpected keyword argument 'EPS'

I get this error and same for some other arguments. What should i do?

And I get -%100 rate of return when i set transaction cost = 0.005, I try to set the EPS but i couldn't succeed yet. Do you have any advise?

— Reply to this email directly, view it on GitHub https://github.com/MehranTaghian/DQN-Trading/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGUZYVCP5LXX5RFTJZRGJDUSZOVRANCNFSM5KYKAGDA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

dekacypher commented 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)

EPS=EPS,

n_actions=n_actions,

deepRLAgent.train(n_episodes) file_name = None

ev_deepRLAgent = deepRLAgent.test( initial_investment=initial_investment, test_type='train')

file_name=file_name, action_name=dataTrain_autoPatternExtractionAgent_windowed.action_name,

deepRLAgent_portfolio_train = ev_deepRLAgent.get_daily_portfolio_value() ev_deepRLAgent = deepRLAgent.test( initial_investment=initial_investment, test_type='test')

file_name=file_name, action_name=dataTrain_autoPatternExtractionAgent_windowed.action_name,

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) ``