Buy and Hold comparison for automated trading strategies

Do my new automated strategy worth to be traded? Is it better than an old “buy and hold” strategy? Let’s see how we can make comparison in this blog article.

Buy and Hold strategy, what is it?

Buy and hold strategy is nothing more than buy an instrument and hold it without doing anything than watch it grows your initial balance. It’s pure passive investment and it’s still something largely “traded” for retirement plans for example.

It’s sometimes more profitable than doing more than one order operation on the same share and that’s the reason it is often used as a comparison to fully automated trading strategies.

How to compare result with buy and hold?

Let’s say that we have a simple strategy made of breakout of the recent highest high with a 200 period moving average acting as a trend filter. Orders are closed with price crossing under more recent lowest low.

Of course this kind of compare is only possible with long only strategies, because we are comparing with passive investment, no short positions could be used.

This simple strategy produce gain because trend is bullish since a while. To compare with buy and hold, we must use the exact same conditions than the strategy itself:

  • same initial capital
  • same start date for investment
  • same price entry as the first trade

What we want here is to set a new indicator that can draw a curve of the buy and hold equity directly over the gain/loss equity produce by the backtest. This way, comparison should be easier.

Let’s define the same parameters in a new indicator called “buyandhold”:

Once these parameters are defined, we could do some calculation:

Here is what we got on the equity curve chart, when the indicator is applied on it (use the wrench on the upper left side of the window):

As you can see in this example, buy and hold is better investment until a sudden gap crash was observed in mid 2007 (orange curve).

Done. This code snippet is a great tool for automated trading development, hope you’ll find it useful!

Of course, comparison should also be made on many others criteria such as drawdown, fees, risk/reward ratio, etc. but it were not the purpose of this approach.

 

Share this

  1. AngelPujalt • 01/16/2017 #

     Lo podrías poner todo en un archivo  itf para testearlo. Gracias 

    • Nicolas • 01/16/2017 #

      Sólo copie / pegue todos los códigos y ya está hecho 🙂

  2. Wilko • 01/16/2017 #

    Great code again!! Thanks!

  3. victormork • 01/16/2017 #

    This is awesome, thanks!

  4. Bard • 37 days ago #

    Brilliant idea, and here’s an interesting video presentation by Matlabs/Mathworks on Commodity Strategies compared to Buy and Hold using Momentum Indicators such as SMA Slope and SMA Difference and then looking at lagging momentum commodities and buying them to profit as they catch up with the other commodities in their sector (Energies, Grains, Softs and Metals) :
    https://uk.mathworks.com/videos/commodities-trading-with-matlab-81986.html

avatar
Register or

Top