Some readers have asked me to share the Percentrank() function for Amibroker. As I have found it somewhere in the blogosphere (can’t remember where though), I have no problems sharing it.
Kudo’s to the original creator! – QD
function PercentRank( Data, Periods ){
Count = 0;
for ( i = 1; i < Periods + 1 ; i++ )
{
Count = Count + IIf ( Ref( Data, 0 ) > Ref( Data, -i ), 1, 0 );
}
return 100 * Count / Periods;
}
Hi, QD:
The original post, along with some improvements offered by the community, can be found here.
Hi TopTick, thanks!
QD