I am using a trailing stop of 5 points, with a trailing percentage of 10.
It looks like it works on backtesting, but not live.
The screenshot is a trade from the backtest: it enters long 1 contract at 1.5121, then exit at 1.5131.
But the same trade live is totally different: it still enters long at 1.5121, but then generates two trailing stop orders at 1.5124, exit with one, but go short with the other!
1. why did the trailing stop not exit at 1.5131 like in the backtest version?
2. why did it generate two orders?
They are programmed as follow:
Code: Select all
inputs: profitgt(50),pctrl(10), stopls(300),stoptype(1);
if stoptype = 1 then
begin
setstopposition;
setpercenttrailing(profitgt,pctrl);
setstoploss(stopls);
end;
if stoptype = 2 then
begin setstopcontract;
setpercenttrailing(profitgt,pctrl);
setstoploss(stopls);
end;