FinRL-Trading icon indicating copy to clipboard operation
FinRL-Trading copied to clipboard

multi stock data training

Open wqingzex opened this issue 4 years ago • 4 comments

for what I understand, it needs 30 stock data to train a model, if there is a lot of stocks(> 30), I want to use all of them to train the model, how can I do that?

for example, firstly I use 30 stock data, then call reset() function, and read next 30 stock data, continue to train model parameters, the key point is that I do not reinit model

is this will work?

wqingzex avatar Dec 31 '20 12:12 wqingzex

I think you need to change parameter named "STOCK_DIM" which is total number of stocks in our portfolio in Env train, validation,trade files.

Chawanvit avatar Feb 01 '21 08:02 Chawanvit

I don't think so, in this repo all stocks in STOCK_DIM form a stock portfolio, in other words, after a prediction, people must do every ops(sell, buy, nothing) according to prediction result, but if I have STOCK_DIM=3000, I can't buy all of them, it may need a lot of money.

wqingzex avatar Feb 02 '21 12:02 wqingzex

From my point of view buy and sell actions are ranked according to the ammount to buy at each time step. So you are right if you have 3000 stocks in your action space hence possibly buy every stock of the 3000 then it can happen that not every stock is bought because the buy function is intitialized in a for loop and the actions are sorted according to the amount to buy maybe you should increase the intitial account balance from 100.000 to a higher amount or lower the HMAX parameter to control the rescaling of the actions because the PPO/A2C... rely on a gaussian distribution and are scaled to [-1,1] you can also verify this by creating a variable (buy_activity/sell_activity) which is returend after testing to track the stocks bought and sold at each time step just modifiy the testing environment if you want i can help you

emjay032 avatar Jun 05 '21 23:06 emjay032

@emjay032 thank you, I'm trying to another method, that is every stock is one episode even in environment, so one episode is done, another one again, I'm doing it

wqingzex avatar Jun 24 '21 02:06 wqingzex