Wednesday, October 26, 2016

Strategy backtest pt.6 - delay factor

On every online broker, stop loss and take profit orders are not always executed at the rate determined by the trader. That's simply due to offers and demands of the markets. Compared to the "ideal" processes of my backtesting tool, this is a disadvantage. In order to account for these imperfections of the orders, I implemented a delay factor that is further described and investigated in this post.




For implementing a delayed execution of orders I found two approaches: Adding/subtracting a constant value from the initially intended rate or multiplying the rate with a factor. For my the latter approach has an important advantage: Currently I work on Dax-values between 1992 and 2004. In this time the value of the Dax moves in a range between 1.500 and 8.300. A constant offset value would have a higher influence in years with a lower rate and less influence in years with higher rates. A relative factor on the contrary has the same influence despite the current rate of the asset. This appears more realistic to me. Therefore I implemented a delay factor in my backtesting tool. I assumed that this factor always reduces the potential of a trade. That means when for example a buy-trade is opened, the opening rate is actually higher than the current rate at market, thus reducing the potential gain of the trade:

openrate = currentrate * (1 + delayfactor)

On my trades with Ger30 on eToro I observed that the delay factor is different for every trade. Considering several trades I made I found that a delay factor of 0,018% matches reality quite well. Lets assume a sell-trade has a stop-loss value of 10.500 and the rate is increasing above this limit. With a delay factor of 0,018% the actual closing rate would be 10.502 - 2 pips higher than intended by the trader. After implementing this factor into my tool, I was interested on its influence on the overall strategy performance. Therefore the strategy itself was the same for different values of the delay factor:

  • market trend: bullish when rate > 50-day-EMA, bearish when <50-day-EMA
  • open buy-trade on rate increase in bullish market
  • open sell-trade on rate decrease in bearish market
  • close trades on reinforced stop loss (2%) and take profit (10%)

The following table shows the influence of the delay factor on the performance of the strategy (click here for an explanation of the performance index DPI)



The results clearly demonstrate the huge impact of the delayed order execution. While the "ideal" process would perform nearly two times better than the Dax itself, the delay factor reduces the DPI to 1,65. An even higher factor of 0,028% - which is still possible in a worst case scenario - reduces the DPI to 1,51. The highest influence can be observed in the year 2002. While the "ideal" process is profitable, the delay factor leads to overall losses.

Due to these findings and my observations of real trades on eToro, I will consider the delay factor in every calculation from now on.

***

Related posts about backtesting:

***
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 tool and my presented results. Furthermore past performance is not an indication for future results. Only trade with money you can accept to loose! 

1 comment:

  1. 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