AI4Finance-Foundation / FinRL-Meta

FinRL­-Meta: Dynamic datasets and market environments for FinRL.
https://ai4finance.org
MIT License
1.28k stars 583 forks source link

How to add features/columns not by specifying parameter tech_indicator_list of StockTradingEnv in env_stocktrading_China_A_shares.py? #124

Open yiivon opened 2 years ago

yiivon commented 2 years ago

We pass the state_space/action_space that must be calculated externally to the constructor StockTradingEnv, and are required to pass in the parameter tech_indicator_list to calculate the state of the internal record. If we add self-calculated columns to the feature data (df), the instances initialized by StockTradingEnv will have errors in subsequent model training because the dimensions of the data columns are different. Is it possible to directly calculate the internal variable state through df in the StockTradingEnv constructor or obtain dimension information from the *_space parameter and disconnect the strong relationship with tech_indicator_list?

Thanks!

rayrui312 commented 2 years ago

We plan to add support for local dataframe files in future versions. However, for now, you may need to edit the data processor file to achieve this. When transferring the technical indicators into the feature array, you can substitute the technical indicators with your prepared features.