Thursday, September 8, 2016

First trading strategy backtest

This week has been quite emotional, since my trades on copper where quite different from my expectations. At one point I kind of panicked and - as result - made wrong trading decisions. That was the clear sign to start working on more detailed and sophisticated trading strategy.



If you search the web for trading strategies you find a lot of information about how to trade and sometimes even backtesting results on the strategies. Anyhow, in order to work on a strategy on your own and to optimize it for your needs, there is no way around an own backtesting tool. There are some commercial tools out there, but since I am an avaricious person, I preferred to work on my own tool. In addition to the financial benefits it (hopefully) leads to a better understanding of the trading strategy and its most influential parameters.

The easiest way to run a backtest is to analyze it in a spreadsheet. Hints and tips how to get started and how to work with the formulas can easily be found on the internet. It was more difficult to find raw data for market values. A good recommendation is Yahoo Finance. They provide historical data for many stocks and indices in ASCII format, that can easily be imported in a spreadsheet. Since I couldn't find the data for copper (not yet) but wanted to get started, I decided to work on the german DAX (Ger30 in eToro). I currently have an open trade on Ger30 in my Portfolio, so any result can also be helpful. The data for the DAX was available on Yahoo, dating back to the beginning of the 1990s.

My first strategy was a rather simple and not promising one: I used the MACD indicator to get my buying signals and only used top loss as selling signal. As you can read in many existing articles on the web, such a MACD based strategy will always lose money, but it is quite easy an good possibility to develop my backtesting tool. More interesting than the overall performance of the strategy was the influence of the trading fees and spreads on the outcome. In many publications - books or blogs - the authors neglect the fees and I was curious if that is the right strategy. The following chart shows the results of my analysis:



First some background information on the chart:

  • The starting point is January 2nd 1991 and the chart ends on September 7th 2016
  • At the starting point, all graphs start with 100% equity
  • The market data is on a daily basis and only the closing prices are shown in the chart
  • I used the example strategy described above
  • For the green graph ("eToro") I considered the trading fees and the spread of eToro;  I assumed that both have been the same in the past as on September 7th 2016
  • For the red graph ("regular broker") I used the trading fees of my primary online broker, it has no fees on holding a position, just on trades (0.25% of trade size, minimum 9.95) - after my repeated research one of the cheapest online broker
  • As initial equity I used $4.000 (this only influences the green and red graph with fees)
Here are my major conclusions on the analysis:
  • The trading strategy is - as expected - very bad and the final outcome is lower compared to a simple buy and hold strategy for the index. 
  • The fees have a major impact on the development of the equity and the final outcome: From 579% without fees to 336% on eToro and 147% on my primary broker respectively. Therefore a meaningful backtest should always consider the fees.
  • For a simple buy-and-hold strategy a regular broker might be cheaper. For trading with a strategy that causes several trades every year, eToro is more suitable.
  • One aspect that can't be seen in the chart but on the spreadsheet: For the Ger30 the overnight and weekend fees have a major impact, while the spread is nearly negligible. This might be different for other markets, depending on their specific spread/fees.

Please don't hesitate to leave a comment with criticism, recommendations or thoughts.



***

Related posts:

Strategy backtest pt.9 - "past performance is not an indication of future results"
Evaluating the strength of a trading strategy
backtesting tool V2


***

Important remark: The results presented above and throughout my blog are no recommendation for your trading! I only share my personal findings and opinions to give ideas and let my followers and copiers know what I am currently working on. I can not guarantee the correctness of my calculations and my presented results. Furthermore past performance is not an indication for future results. Only trade with money you are prepared to lose! 

2 comments:

  1. This is the first time i read your blog and admire that you have posted on this...I really found useful.Keep updated.

    ReplyDelete
  2. Am short of words for the amazing profit you helped me earn in just a week with binary options strategy am so sorry I doubted at the beginning, I invested $200 and earn $2,500 in just one week, and kept on investing more, today I am financially successful, you can contact him via email: tdameritrade077@gmail.com
    Via whatsapp: (+12166263236)
    I advice you shouldn't hesitate. He's great.

    ReplyDelete