You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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), [])
)
The text was updated successfully, but these errors were encountered:
ExtEEd
changed the title
Incorrect initialization if env_stocktrading for single asset
Incorrect initialization in env_stocktrading for single asset
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), [])
)
The text was updated successfully, but these errors were encountered: