How to train the model for different stocks in machine learning/Neural Network

I have complete Machine learning in Finance course. In all the courses we are training for a single security for eg 'AAPL'  with all the OHLCV data and it is mentioned in the courses that it will take days to train if it is Neural Network. But if we are going to use the trained model in IB Broker, how do we do the training for Multiple stocks/Security. Do we have to train for each machine learning/NN model seperately for each stocks or do we need to mention it somewhere in the Ibridgepy codes. Kindly suggest how to train the model for multiple stocks and any code snippets would be helpful.

Hi  Vignesh,

The model in any machine learning approach learns from the data we provide. By learning we mean to say that the weights inside the model are balanced such that the model predicts an action as close as the "financially correct" action.



To run the ML model for different stocks, it is best to train different models for each of the stocks and then deploy them for live/paper trading.



An argument can be made that the prices can be normalized in a particular range, and then, the entire basket of stocks can be made to run on a single model trained from such a normalized sample. But this approach would be incorrect. The larger $ value of some script may dominate such a model and hence we should avoid that.



As you rightly noted, that model training takes a long time, but when you deploy the models, say after training on 10 years data, you have some model weights. Then after running the model for 1 day, you can retrain the model by taking the initial weights from the 10 years training, and then training it for 1 day more based on the latest data. This retraining will not be very time consuming, compared to the time already spent in training the model on 10 years of data.



Hope this helps!

Thank you so much. This helps a lot!