Using setoption("worstrankheld") with rotational backtesting

Hi friends,
I'm attempting to do a rotational backtest where once a symbol drops out of the top 9 ranking, it sells. However, I'm also using a conditional statement that makes it rotate at the beginning of each month. Worstrankheld appears to have no effect when done using rotational backtest. Thanks for any advice.


EnableRotationalTrading(True);

numpos=optimize("Number of Positions:",4,3,6,1);

SetOption("MaxOpenPositions",numpos);

worstrank=9;

SetOption("WorstRankHeld",worstrank);
SetPositionSize(100/numpos, spsPercentOfEquity );

score=100+ROC(C,90);

monthend=Month()!=Ref(Month(),-1);
SetTradeDelays(1,1,1,1);
BuyPrice=Close;
SellPrice=Close;

PositionScore=IIf(MONTHEND,score,scoreNoRotate);

Filter=1;


1 Like

thanks FX for the confirmation, I did do a search before posting but missed this one. Thanks again!

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.