Skip to main content

Percent Rank for Amibroker (AFL)

genkumag over 14 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 2)
  • Tags:
    amibroker, function

Not an indicator per se, but a rather useful function for developing sophisticated indicators in Amibroker.

Found this in the internet some months back, can’t remember where.

Indicator / Formula

Copy & Paste Friendly
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;
}

2 comments

1. ole
over 14 years ago

Why go through this function (does not work unless change “PercentRank” name) instead of using PercentRank() in AmiBroker? Same result.

2. ole
over 14 years ago

Why go through this function (does not work unless change “PercentRank” name) instead of using PercentRank() in AmiBroker? Same result.

Leave Comment

Please login here to leave a comment.