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

TypeError : tuple indices must be integers or slices, not tuple #341

Open
hanggezhuai opened this issue Oct 10, 2024 · 1 comment
Open

Comments

@hanggezhuai
Copy link

when i run /Paper Trading/Automated_Paper_Trading.ipynb

train(start_date = '2022-08-30',
end_date = '2022-09-08',
ticker_list = ticker_list,
data_source = 'alpaca',
time_interval= '1Min',
technical_indicator_list= INDICATORS,
drl_lib='elegantrl',
env=env,
model_name='ppo',
API_KEY = API_KEY,
API_SECRET = API_SECRET,
API_BASE_URL = API_BASE_URL,
erl_params=ERL_PARAMS,
cwd='./papertrading_erl', #current_working_dir
break_step=2e5)

i got an error, TypeError: tuple indices must be integers or slices, not tuple, it seems happen in
agent.states = env.reset()[np.newaxis, :]
i want to know why

@DebjyotiRay
Copy link

This is due to the reset function inside the StockTradingEnv class inside the env_stocktrading_np.py code

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

2 participants