Percent Rank for Amibroker (AFL)
genkumag over 14 years ago Amibroker (AFL)
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
Leave Comment
Please login here to leave a comment.
Why go through this function (does not work unless change “PercentRank” name) instead of using PercentRank() in AmiBroker? Same result.
Why go through this function (does not work unless change “PercentRank” name) instead of using PercentRank() in AmiBroker? Same result.