Neural networks for trading,
The number of layers, activations, and dropout percentage all are optimized during training.
A Brief History of the Perceptron
I use the AdamOptimiser with a cyclic function learning rate. Not really.
However, maybe it provides a slightly biased random number generator. The loss curve for train orange and validation blue data sets is shown below.
Trading with AI
The lines are very jumpy, and maybe using a larger batch size could help with that. This is not too surprising. Thus, it could hint at some over-training; something to be further checked. Loss function for 4k iterations.
Only the best model neural networks for trading saved. Results How does this latest model perform?
Subscribe to RSS
Below is the actual gradient vs the predicted gradient. The figure below shows a confusion matrix for the actual gradient vs the predicted gradient. This imbalance could come from the nature of the dataset and the model, i. The model learns this, and thus quoting accuracy can be a bit misleading.
This will become very important when actually developing trading strategies. Confusion matrix showing accuracy for up and down predictions. The cover plot is shown again, focusing on just the validation and test datasets. But there are times when trends of gradient changes are indeed followed.
Remember, the validation dataset is only used in the training steps to determine when to stop training i. The test dataset is not used anywhere. Predictions for the validation and test datasets. How stable was our result?
In training sessions the distribution of the accuracy for predicting the gradient is shown below the histogram in green. The accuracy of each training session is plotted against run number in orange. It turns out there was actually a better result I could have used. The take-away from the green histogram is that we are learning something. Some models just suck. And if no models sucked that would be an alarm bell. I believe with more playing around and some tweaking this number can be improved.
Also, plenty more checks and studies can be performed. Will it actually make money when backtesting?
Predicting gradients for given shares
How about when trading live? There is a huge amount to consider. From using the pretty cool backtrader library, to plugging it into the IB API, these will be topics for the next article.
Trade Prediction based on neural networks
Joshua Wyatt Smith.