How to avoid trades on particulas symbol in rotational test, was: Backtester isn't

I have been using a rotational system for a while; but wanted to make some manual overrides on the system.

e.g. I want to avoid the system to consider a specific stock for a specific period of dates.
So I added a code that will decrease the positionscore of a specific stock in a date range as below. Now if I use this date range in the backtester, the Explore section correctly shows that this stock has reduced the positionscore; but the backtester ignores it and still chooses this stock in the trades generated. Any suggestions to fix this or perhaps different way to implement it?

dt = DateTime();
start_dt = _DT( "2019-01-01" );
end_dt = _DT( "2019-01-20" );
datewindow = dt >= start_dt AND dt <= end_dt;

avoidticker1 = "LSE:HIK";
dumpscore = (Name() == avoidticker1 ) AND datewindow;

finalscore= IIf(dumpscore, 0.90*finalscore, finalscore); //reduce score by 10%
PositionScore = finalscore;

Use Detailed Log to debug your backtests, follow precisely this: How do I debug my formula?

To avoid trades for particular ticker completely you should just set PositionScore to ZERO, so not 0.90* finalscore, but 0 (zero).

PositionScore = IIF( Name() == avoidticker1 AND datewindow, 
                     0 /* ZERO MEANS DON'T TRADE THIS SYMBOL */, 
                     finalscore );

It is all explained in detail in the Users' Guide http://www.amibroker.com/guide/afl/enablerotationaltrading.html

Also DateTime is not simple number. You should use DateTimeDiff function for comparisons of DateTime, not mere >=. If you want to use ordinary comparison you should use DateNum instead.

Thirdly - use code tags as per forum rules.

Thanks. Datetimediff did the trick.