Hi All,
I was developing a trend following system in Amibroker and have come across several mind-numbing errors.
Consider for example, this snippet
Here, this is the basic trend marker. But inspite of bullish markets like 2006,2007, my system is initiating counter trend trades. Where am I going wrong, those days where the trade is taken, I have personally checked out the values, everything is what it should be.
More importantly,
My average trade length is just 1 bar. This is highly worrying.
Do advice.
AceX
P.S: Is it possible to see the raw signal values, after a backtest. That might help.
I was developing a trend following system in Amibroker and have come across several mind-numbing errors.
Consider for example, this snippet
Code:
[COLOR="Blue"]TimeFrameSet[/COLOR]([B]inWeekly[/B]);
LongTrend=[COLOR="Blue"]IIf[/COLOR]([COLOR="Blue"]EMA[/COLOR]([B]C[/B],11)>[COLOR="Blue"]EMA[/COLOR]([B]C[/B],22),1,0);
ShortTrend=[COLOR="Blue"]IIf[/COLOR]([COLOR="Blue"]EMA[/COLOR]([B]C[/B],11)<[COLOR="Blue"]EMA[/COLOR]([B]C[/B],22),1,0);
[COLOR="Blue"]TimeFrameRestore[/COLOR]();
Code:
...
code for buy/sell/short/cover
buy is dependent on LongTrend
Short is dependent on ShortTrend
...
More importantly,
My average trade length is just 1 bar. This is highly worrying.
Do advice.
AceX
P.S: Is it possible to see the raw signal values, after a backtest. That might help.