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

Incorrect initialization in env_stocktrading for single asset #1175

Open
ExtEEd opened this issue Feb 27, 2024 · 0 comments
Open

Incorrect initialization in env_stocktrading for single asset #1175

ExtEEd opened this issue Feb 27, 2024 · 0 comments

Comments

@ExtEEd
Copy link

ExtEEd commented Feb 27, 2024

In finrl/meta/env_stock_trading/env_stocktrading.py in function _initiate_state when the environment initializated for single stock - it always initialize as zero.

From line 419
else:
# for single stock
state = (
[self.initial_amount]
+ [self.data.close]
+ [0] * self.stock_dim
+ sum(([self.data[tech]] for tech in self.tech_indicator_list), [])
)
I think it should be something like that:
else:
# for single stock
state = (
[self.initial_amount]
+ [self.data.close]
+ [self.num_stock_shares[0]] * self.stock_dim
+ sum(([self.data[tech]] for tech in self.tech_indicator_list), [])
)

@ExtEEd ExtEEd changed the title Incorrect initialization if env_stocktrading for single asset Incorrect initialization in env_stocktrading for single asset Feb 27, 2024
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

1 participant