// Simple example rotational trading system // This is contrarian strategy - // it buys 10 worst stocks - the ones that suffered the most in last 5 days // (stocks having worst 5-bar rate-of-change) // number=Optimize("number",10,10,80,1); MaxPositions = 10; SetOption("MaxOpenPositions", MaxPositions ); SetOption("WorstRankHeld", 50);//MaxPositions + 5 ); SetOption("MaxOpenPositions",10); SetPositionSize( 100 / MaxPositions, spsPercentOfEquity ); // trade on next day open SetTradeDelays( 1, 1, 1, 1 ); BuyPrice = Open; SetBacktestMode( backtestRotational ); // offsetting by large positive number // makes sure that our score is always positive and we don't enter short trades PositionScore = 1000-ROC( C, 5 );