I can't seem to get a H.G. type strategy to work especially well on daily bars. I have a rather complex version of the code, but I was playing with a "Speghetti Code Version" and I still couldn't get it to work very well on a reasonable universe of stocks. I'll post the code I whipped up so people (if inclined) can rip it apart and make improvements / suggestions. I tried a few different exits including Trailing ATR, Parabolic, and some other stuff. Here goes:
inputs:
ADXLength (14),
CUTOFF(30),
XMALEN(20);
VAR:ADX14(0),
XMA20(0),
LongLoss (0),
LongProfit (0),
ShortLoss (0),
ShortProfit (0);
ADX14=ADX(14);
XMA20=XAVERAGE(C,XMALEN);
LongLoss = lowest(low,3) ;
LongProfit = Highest(high,10);
ShortLoss = Highest(high,3);
ShortProfit = Lowest(Low,10);
if (marketposition = 0) and (ADX14 > CUTOFF) and (close < xma20) and (TLSlope(Average(Close, 5)[1], 1, Average(Close, 5), 0) > 0 )THEN BEGIN
Buy ("L.Smurf's H.G. LE") next bar at high stop;
end;
if (marketposition = 0) and (ADX14 > CUTOFF) and (close > XMA20)and (TLSlope(Average(Close, 5)[1], 1, Average(Close, 5), 0) < 0 ) then BEGIN
SellShort ("L.Smurf's H.G. SE") next bar at Low stop;
end;
{
if marketposition =1 and barssinceentry >= 1 then Sell ("L.Smurf's LX Loss") next bar at LongLoss stop ;
if marketposition =1 and barssinceentry >= 1 then Sell ("L.Smurf's LE Profit") next bar at LongProfit stop ;
if marketposition =-1 and barssinceentry >= 1 then BuytoCover("L.Smurf's SX Loss") next bar at ShortLoss stop ;
if marketposition =-1 and barssinceentry >= 1 then BuyToCover("L.Smurf's SXProfit") next bar at ShortProfit stop ;
}