_SECTION_BEGIN (“System Parameters”);
//=================================================================================
//Parameters
//=================================================================================
//=================================================================================
//Entry & Exit
//=================================================================================
Rank = ; //Criteria for rotation
Cond1 = Rank > 0; //prevents short trades
Cond2 =
OnLastTwoBarsOfDelistedSecurity = BarIndex() >= (LastValue(BarIndex()) -1) AND !IsNull(GetFnData(“DelistingDate”));
LESetup = Cond1 AND Cond2; //Any additional buy rules apart from the rotational criteria – e.g index, price filters etc
LE = Ref(LESetUp,-1) AND NOT OnLastTwoBarsOfDelistedSecurity;
//=================================================================================
_SECTION_END();
_SECTION_BEGIN (“Backtesting Options”);
//=================================================================================
//Backtesting Parameters
//=================================================================================
posqty = Param(“# Positions”,20,1,100,1);
Eq = Param(“Initial Equity”,100000,1,10000000,1);
SetOption(“InitialEquity”,Eq);
SetOption(“MaxOpenPositions”,posqty);
SetOption(“UsePrevBarEquityForPosSizing”,True);
SetOption(“AccountMargin”,100);
SetTradeDelays(0,0,0,0);
SetBacktestMode(backtestRotational);
EOM = Month() != Ref(Month(),-1);//First trading day of the month
score = Ref(Rank,-1);//score is the rotational criteria
Score = IIf(LE,score,0);
PositionScore = IIf(Year()>=1985 AND EOM,Score,scoreNoRotate);
//———————————————————————————
SetPositionSize(100/posqty,spsPercentOfEquity);
//=================================================================================
_SECTION_END();
_SECTION_BEGIN (“Exploration”);
//=================================================================================
//Exploration
//=================================================================================
Filter = LESetup;
AddColumn(Rank,”Rank”,1.2);
//=================================================================================
_SECTION_END();