Rotational Strategy - Buying rank different to selling rank

Hi,

Is there a simple way to modify the simple rotational strategy to buy when the top 5 ranked on a ROC on a monthly basis but only sell when the stock falls below the the top 10 ranking? So I suppose in general a different ranking for buying and selling.

Thanks for any help.

Kim

// Simple example of rotational trading system
// it buys the "bests" stocks performing over a lookback period.


MaxPositions = 5; //Optimize("Pos",5,2,20,1);
SetOption("MaxOpenPositions", MaxPositions  );
SetOption("WorstRankHeld", MaxPositions);
SetPositionSize( 95 / MaxPositions, spsPercentOfEquity ); 

// trade on next day open
SetTradeDelays( 0, 0, 0,0 );
BuyPrice = Open;

SetBacktestMode( backtestRotational );

// offsetting by large positive number 
// makes sure that our score is always positive and we don't enter short trades
LookBack = 52;//Optimize("LB",36,4,104,4);
PositionScore = 10000 + ROC( C, LookBack); 

@kim have you tried changing this:

SetOption("WorstRankHeld", MaxPositions);

to this:

SetOption("WorstRankHeld", 10);
1 Like

That makes simple sense; little embarrassed. Thanks for your help. Kim