Hello
I am trying to create an entry rule so that the entry is only executed the following day if the high exceeds the previous days high by $0.10 (buy). I haven't even got to the $0.10 yet, just working on exceeding the previous high.
My question:
If I am using (buytriggered, -1) for an entry signal, and also have the setup referencing previous bars, do I need to account for that in the bar setting, so for example, if I am wanting 3 lower lows, this would normally be Ref(-1/2/3), but since I am using a the -1buytrigger do I need to drop these back one (Ref(-2/3/4) ?
And if anyone can help me with the code for only executing when the high exceeds previous high by $X that would be greatly appreciated ...
//The Trend
X=MA(C,10);
Y=MA(C,50);
Z=MA(C,200);
Uptrend1 = C > X AND X > Y;
Uptrend2 = Z > Ref(Z,-1);
Uptrend = Uptrend1 AND Uptrend2;
Downtrend1 = C < X AND X < Y;
Downtrend2 = Z < Ref(Z,-1);
Downtrend = Downtrend1 AND Downtrend2;
// The Setuo
id = H < Ref(H,-1) AND L > Ref(L,-1);
LLL = L < Ref(L,-1) AND Ref(L,-2) < Ref(L,-3) AND Ref(L,-3) < Ref(L,-4);
LLI = id AND Ref(L,-2) < Ref(L,-3) AND Ref(L,-3) < Ref(L,-4);
HHH = H > Ref(H,-1) AND Ref(H,-2) > Ref(H,-3) AND Ref(H,-3) > Ref(H,-4);
HHI = id AND Ref(H,-2) > Ref(H,-3) AND Ref(H,-3) > Ref(H,-4);
buytriggered = Uptrend AND (LLL OR LLI);
selltriggered = Downtrend AND (HHH OR HHI);
Buy = Ref(buytriggered, -1) AND H > Ref(High,-1);
Short = Ref(selltriggered, -1) AND L < Ref(Low,-1);
Sell = Short;
Cover = Buy;
Thanks