I'm trying to create a simple strategy using EL using a trailing stop (actually reversal) based on the high(low) of the last bar. If I'm long, I want to exit and go short if price drops to 1 tick below the low of the last bar. If I'm short, I want to cover and go long if price rises to 1 tick above the high of the last bar. I'm applying this to futures and basically want to reverse position based on the break of the previous bar high or low. When applied to a chart, i get entries and exits, but not when they should be. The code skips many trades which should take place. Any ideas what I'm doing wrong?:crap:
Thanks in advance.
if Marketposition = 0 and date = 1110621 then begin
Buy ("long") 1 contract next bar at high[1] + 1 point stop;
Sell short ("short") 1 contract next bar at low[1] - 1 point stop;
end;
if Marketposition = -1 and last >= high[1] + 1 point then begin
Buy("Long") 1 contracts next bar at high[1] + 1 point stop;
end;
If marketposition = 1 and last <= low[1] -1 point then begin
Sell short("short") next bar at low[1] - 1 point stop;
end;