top of page

MA200 trend following strategy

Updated: Feb 29

This is the mother of all strategies, the strategy learned on lesson 1. The MA200 long only strategy. Although already widely recognized, there's value to revisit old edges to see if they are holding up. In this post we're going through how this strategy has performed on the Swedish OMXS30 index.


We're also investigating if there are other Moving Average types that works even better, like the Exponential Moving Average.


So the conditions here are super simple.

  1. Enter a long trade when the price crosses over MA200

  2. Sell when close crosses under MA200


Here are the results compared to just buying and holding throughout the whole backtest period (15 aug 1997 until today)


So what do we see in the equity curves? We see that the MA200 strategy has similar overall return as buying&holding but with smaller drawdowns.


If we go in to the backtest report we see that we are in market 61.58% of the time, we have a winrate of 25.58% and a gain/loss ratio of 1.99.



Looking at how the MA200 strategy has performed compared to just buy&hold on a yearly basis we see that the MA200 underperforms the index on 13/26 years.


So what do you actually get out of running a strategy like this? You will get similar returns, with lower drawdowns and the chance to put your capital elsewhere around 38% of the time (when the index is below MA200).


But can we improve it?

Well, you can always improve the backtest of a strategy, but to avoid curve fitting I'll just try one more thing: testing some other moving averages. I will not go through the difference between the moving averages. It's just one google away.


Anyway, here are the results. I have to say I like the results of Triangular best.

Type

Gain

Winrate

Trades

Avg. gain

Max DD

Simple

1,745.70

26.44%

87

20.07

518.99

Exponential

1,818.95

27.84%

97

18.75

434.39

End Point

1,163.65

29.50%

200

5.82

618.18

ZeroLag

841.66

28.44%

225

3.74

561.31

Weighted

1,932.08

26.09%

115

16.8

434.63

Hull

678.64

30.40%

250

2.71

701.17

Wilder

1,121.66

22.22%

72

15.58

748.23

Time Series

1,197.66

29.65%

199

6.02

641.97

Triangular

1,867.92

25.32%

79

23.64

464.06


That was it. I think it's a viable strategy that can be combined with other edges to make something even better.



The ProRealTime™ code

DEFPARAM CumulateOrders = False 

MA200 = average[200, MovingAverageType](close)

BuyCondition = close crosses over MA200
SellCondition = close crosses under MA200

IF BuyCondition THEN
BUY 1 CONTRACT AT MARKET
ENDIF

IF SellCondition THEN
SELL 1 CONTRACT AT MARKET
ENDIF

Please optimize the variable MovingAverageType between 0-8 with step interval 1 to try out the different moving average types available in ProRealTime

91 views0 comments

Recent Posts

See All
bottom of page