This is for Rithmic and happens on Rithmic paper trading and live trading.
Code: Select all
if marketposition > 0 then begin
sell next bar at entryprice - atr_f1 * AvgTrueRange(atr_len1) stop;
end;
Code: Select all
if marketposition > 0 then begin
sell next bar at entryprice - atr_f1 * AvgTrueRange(atr_len1) stop;
end;
You need to post more codes. Your snippet does not tell the story.My code appears to be executing a stop order twice. When I am long, the code should place a stop order every interval. Every time it should place a stop order, two orders are actually entered within a few milliseconds of each other. If I try to close one, it is entered again immediately. Always two orders and never more or less. When the stop price is triggered, one order closes the position and the next reverses it short. So I end up with a reversal instead of closing.
This is for Rithmic and happens on Rithmic paper trading and live trading.
if marketposition > 0 then begin
sell next bar at entryprice - atr_f1 * AvgTrueRange(atr_len1) stop;
end;
Any ideas?