For example:
if AverageFC(10) crosses over AverageFC(100) then
buy next bar at market;
if marketposition = 1 then begin
sell next bar at entryprice + 10 limit;
sell next bar at entryprice - 10 stop;
end;
When one of the 2 exit orders is hit, the other is IMMEDIATELY cancelled.
However, if I use the following EL code, the other order is not canceled until the beginning of the next bar.
if lastbaronchart and NTConnected(1) then begin
if AverageFC(10) crosses over AverageFC(100) then
NTBuyMarket("LE",1);
if NTmarketposition("") > 0 then begin
NTSellLimit("LPT",entryprice + 10, 1);
NTSellStop("LStop",entryprice - 10, 1);
end else begin
NTCancel("LPT");
NTCancel("LStop");
end;
end;
I appreciate your help in advance!
Comment