AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.37k stars 2.28k forks source link

StockTradingEnv.py #1152

Open CoderM8n opened 5 months ago

CoderM8n commented 5 months ago

Why is the state space for the StockTradingEnv a 291 dimension space? how is the state_space derived? what is the rationale?

stock_dimension = len(train.tic.unique()) state_space = 1 + 2stock_dimension + len(INDICATORS)stock_dimension

Stock Dimension: 29, State Space: 291

michaelkawaicheung commented 3 months ago

The state space is derived as follows:

Adding these components together, the state space for the StockTradingEnv is a (1 + 2stock_dimension + len(INDICATORS)stock_dimension)-dimensional space, encompassing the account balance, stock prices, stock positions, and indicators for each stock.