Saturday, December 30, 2017

Backtesting engines and some initial results

The end of year arrived with a idea flourishing in my head. That to put some of the market insights provided by my algorithms in to a automated trading strategy, as I wrote in one of my previous posts (a serious post, most are not, nevertheless I don`t suppose you mind and if you do its not really my business, I do one thing very well -money- so either you like it or not that's the situation - I`m not sure why I`ve just remembered I need something from Ebay...) For that idea to become reality I needed to be able to build a testing engine from the scratch so, given the fact that this period of the year is not very active most people are thinking at other things than trading, I had the time to put together and figure it out how the testing engine must be done in order to allow me to accomplish most of the tasks I use in my discretionary trading. While I was doing that I`ve stumbled upon some unexpected results shortly after I begun. I`ve started building the testing engine around the most simple buy/sell "rule" or indicator or market insight, call it whatever you want, provided by my algorithms and obviously after I was done and satisfied by my most basic creation I hit the "Backtest" button and find out the engine is working and now I can add some complexity to it. As a parenthesis here, I do not have enough historical data to be able to say that any back test I do now its relevant, I`m only testing on last 4 months of data on Crude Oil but the point is to have the back testing engine and the strategies to be back tested in place. The results of my most basic strategy were not very good, as expected, but since that was not what I was after in this phase I`ve continued to the phase 2, that of adding some more complexity to it. Still basic stuff and without using other complex trading rules I`ve unexpectedly stumbled upon a reasonable good strategy that could have been applied in the last 4 months and produced a good return even for my discretionary trading. I have to remind here that 4 months is irrelevant however since the result is quite good and I have not optimized anything I will leave this system as it is curious about how will it do in the future. Here are the results:
    First and foremost the backtest is not relevant with 4 months of data I have to repeat this over and over again and after that the results, while certainly not extraordinary, show a trend following strategy that (assuming the same results would be given after real robustness tests would be performed on a few years of data) most people would be quite happy to have I believe especially since no optimization or curve fitting was used, nothing at all, there is not a single parameter in this backtest that was optimized in any way.
 
Now, lets move on. After the above strategy (I`m already calling it strategy even if its just the basic testing engine), gave me these results I left it as is and went to the next phase of building the engine. Phase 3, where I copied the above engine and added some more complexity, the point being all this time not to create a trading strategy but to create the testing engine that I`ll be quickly adapting to whatever idea comes in to my mind. The results of phase 3 of the back test engine building can be seen bellow:
One commentary on the result, it shows a improvement of the previous results but the improvement comes from a few trades that achieved a large gain however you know or you should know that many successful trading strategies results are given by very few trades that hit the jackpot as is the case of the well known trend following strategy the Turtles used back in the `80s. Anyway, I`m done with the phase of actually trying to develop the back testing engine as I have everything required (at least for what comes in to my mind now)  at this point and now I should start to feed this back test engine with some of the data I use in my discretionary trading. I will do so and feed it with data crunched and combined in many different ways in time but for the moment I`m done with back testing this year. What I`m actually puzzled now is how would these two strategies perform if back tested on 10 years of data. I know how I build them and what they have under the hood and I would not be surprised if they would actually prove to be reasonably good even if for me are much to simple to think seriously about creating the robot that would place trades automatically based on them. And now that I`ve remembered that's another headache, a robot that would place trades automatically requires more coding and, as I said since I know I won`t actually use it my mood of doing it is at very low levels right now. But maybe in time, when the level of my greed of making money from the markets simply because I can will be reduced and I have already got enough I will leave a robot to do the job for me, until then I`ll continue to trade myself and show you results you did not believe are possible. The advice that I have is ride with me or stay out of my way :) 
 
Happy New Year!    

No comments:

Post a Comment