Oh I have tested many trend following systems too but the consecutive losses, consistently low percentage winners (in the 30's) and excessive draw down are not good results.
Originally Posted by Harro26
I already use an index filter on my testing. Below I have tried your MA > and the results are not good.
Filter your buys using the index you are trading against. I.E. buy = ma(xao,10)> ma(xao,30). Use XAO = Foreign("xao","Close") in amibroker to do this. This is why I still had a 22.5% profit during the crash as I was out of the maket for the majority of it getting back in for some quick profits during the April - May bounce.
Typically, a moving average cross over, a moving average cross or a trailing stop is the best way I know how to exit if the trend changes!!!!!!
If the strategy averaged 22% through the GFC then this recent market trajectory is but a blip. But that is the whole idea of back testing a strategy. We want to be as honest to ourselves as the software allows and with Amibroker you can code in complete honesty.
Like I said earlier all of this is good in theory
but when the market isn't moving as it hasn't since October the trend trading strategy probably isn't going to work. I am sticking with it in the hope that the market will make up it's mind and eventually move in the correct direction, up.
This is a basic trend following strategy.
Start capital 100k (set in tester). The maximum stop loss (set in tester) is set at 20% per trade. Commission is $30 (set in tester). Trailing ATR stop set at 5 * ATR(50).
PosQty = 10;
SetOption("MaxOpenPositions", PosQty );
PositionSize = -100/PosQty;
PositionScore = Random();
V1 = EMA(C*V, 50) > 25000;
ATRMultiplier = Param("ATR Multiplier", 5, 1.5, 10, 0.5);
ATRRange = Param("ATR Range", 50, 1, 100, 1);
TrailStop = ATRMultiplier * ATR(ATRRange);
ApplyStop(2, 2, TrailStop, 1);
Call = Foreign("^AORD", "C", True);
Check = MA(Call, 10) > MA(Call, 30);
Buy = Cross(MA(C,20),MA(C,50)) & Check & V1;
Sell = 0;