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;