I read several threads on trailing stops and I haven't been able to find the solution the issue below, see if I can get some help from you guys.
I am backtesting a strategy on daily bars and have setup a trailing stop in the Initialize() method as follows:
SetTrailStop("Entry1",CalculationMode.Percent,MyPe rcentInput,false);
The error appears when the range (Hi-Lo) of the entry bar is >= size of the trail stop, but in the direction of the trade. Obviously, it would be right if it was against the position, not in favor.
If the range of the entry bar is < size of the trailing stop, there is no problem.
For e.g. the trail stop = 1point, entry short at price = 20, Hi=20.1, Lo=19, Close=19.1.... In this case the price would close 0.9 points in the direction of the trade, moving the initial trailstop from 21 to 20 for the next bar. However the backtesting shows the exit on the same entry bar at the price of entry.
I don't see any error on the log.
I've tried playing with the following, with no luck:
"Calculate on bar close"
"bool simulated"
"Entry Handling"
Copied the SetTrailStop into the OnBarUpdate()
Any ideas?
Thanks

Comment