I have created a Strategy based on the well-known TrailBuilderExample logic, for stopping-out of a trade that turns to losing money.
The default trail distance is 5 ticks from the trail trigger.
When I run this Strategy as (State==State.RealTime) on SIM101 , trailing seems to work and in case of a losing trade I am usually stopping-out around 5-6-7 ticks away from the trail trigger, as it should be.
When I backtest the same Strategy as (State==State.Historical) , trailing fails to work, and the whole strategy turns red because of huge trailing stop losses. I can see in the Strategy Analyzer that many trades stopped-out after 60-70 ticks (!) in the losing territory although the setting was only 5 ticks !
It seems as the losing trades were executed as completely unprotected. That is impossible to happen in real since the trailing logic is there to prevent exactly that from happening.
If it doesn’t stop-out at exactly 5 ticks, it should do that at 6, or even 7 ticks, but not at 70 ticks !
I can understand that running a backtest is not exactly like actually running the Strategy, and there are many simplified assumptions simulating the market movements, but on the other side not “listening” the trailing logic at all, is indeed problematic.
This would greatly reduce the very usefulness of backtest as an evaluation tool.
Maybe I am doing something wrong. Maybe some of my settings are not appropriate and need some adjustments.
I would like to ask you for your advice. Has anybody noticed a similar case, where your trailing stop logic is not actually or properly working in backtests ?

Comment