| 
 PureBytes Links 
Trading Reference Links 
 | 
Perhaps you can use the function below, where I've used RSI and ROC 
as example criteria to cross-rank a list:
function XSecRanksVarSet(List, Crit, Lookback)
{
	global PercRank;
	
	if (Crit==1) CurrInd=RSI(Lookback); else if (Crit==2) 
CurrInd=ROC(C,Lookback);
	
	for (j = 0;( Naam = StrExtract( List, j ) ) != "" ; j++ )
	{
		SetForeign(Naam, True);
		if (Crit==1) ChoiceVar=RSI(Lookback);
		else if (Crit==2) ChoiceVar=ROC(C,Lookback);
		VarSet("PeerInd"+j, Nz(ChoiceVar,LastValue(MA
(ChoiceVar,Lookback))));
		RestorePriceArrays();// to get out the influence of 
SetForeign
	}
	Rank=1;
		
	for (i=0;( Naam2 = StrExtract( List, i ) ) != "" ; i++ )
	{
		if (Name()!=Naam2)	Rank=Rank + IIf( CurrInd > 
VarGet("PeerInd"+i),1,0);
			//if (RankCrit==0) Rank=Rank + IIf( CurrInd > 
VarGet("PeerInd"+i),1,0);
			//else Rank=Rank + IIf( CurrInd < VarGet
("PeerInd"+i),1,0);
	}
	
	PercRank=Rank/i;
	
	return Rank;
}
In your rotational code, you then simply adjust your PositionScore by:
InOut = iif(Rank>Ref(Rank,-1),1,0);
PositionScore = InOut* Your Positionscore;// If PositionScore = 0, no 
position.
Just some guidance, hope it helps.
PS
"Next time, you contribute to the group?"
--- In amibroker@xxxxxxxxxxxxxxx, "anand_huprikar" <huprikar@xxx> 
wrote:
>
> I want to include a condition  that the rank today has to be better 
> (lower)than   rank yesterday before taking a position in the 
> rotational trading  system.Can this be done in the AFL?
>  Thanks
>
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links
<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
    Individual Email | Traditional
<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)
<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 
 |