Hello, welcome back to my blog about automated trading. Last week I
have presented how to use neural network for prediction. This week I will present algorithm which is using neural network predictor.
For the source code, please download repository and update to branch 12-prediction-3, changeset 079ca8d735d9.
For the source code, please download repository and update to branch 12-prediction-3, changeset 079ca8d735d9.
What is there
The main code is in the classes Algo2 and Algo2TestApp. To make it run you will have to set up username and password for MbTrading account (Algo2TestApp line 44). I can't publish my own. Other way is to implement different historical provider which supports intraday data.
Algorithm works with pre computed network which is in file Algo2-nn-predictor.txt. I had to do it in this way, because it takes hours on my computer to calculate the network. Note that for network calculation I have used only historical data which are not the part of the backtest. The way how algorithm works is pretty straightforward. It builds up the observations which are then exposed to the network and network says whether to buy or not. So let's see the result.
Results
Backtest was done from 2015/10/26 till 2016/04/22 with initial capital 30.000 USD and 10 USD per transaction cost. Final result was 27.000 USD. This means I would not bet my money on this version. On the other hand the risk was managed well. All trades were open and closed within the same day and stop and target prices were known at the time of opening. This gave me fuel to think agbout the improvements - e.g. add another factors to the neural networks.
That's it for today. Next week I will look to some of the traditional technical indicators and see how I can connect them with what I have. Thank you for reading!
No comments:
Post a Comment