Course Name: Trading with Machine Learning: Classification and SVM, Section No: 5, Unit No: 4,
Hello,
Very nice model out here. I am tweaking it to daily trading and am wondering followings:
- is there any rule about test sample size? I noticed that as the test size go up (> 1200), the model loses it's precision.
- in live trading context, how can we load pre-trained model and inject the lastest price to get the signal?
- finally, after how many bars (or days of trading) the model should/must be retrained to keep its accuracy? Here, I suppose the new sample takes into account the latests prices within fixed rolling window.
Thank you.
Eric
Hi Eric,
Regarding the test sample size, this can be changed as per your choice, but it is advisable to give at least 70% data as train data and 30% as the test data for good results.
In the live trading scenario, say you have an ML model trained on 10 years of data. The model thus trained can be saved to your local memory. Please refer to this article on model persistence.
Then as you stream the live prices, just load the model from the file, and predict on the new incoming price data.
You may retrain your model at the end of the trading day to be ready for the next day. It depends on the asset and backtesting results as well. You may explore different frequencies of retraining and see what works best for your selection of the model and the asset.
Hope this helps!