MQL5: How to Rank an Array's values
MQL5: How to Rank an Array's values
Loading saved threads...
trader · External communityPost link
External question — Stack Overflow Stack Exchange
Author: trader
Original post: https://stackoverflow.com/questions/56166824
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I used R and the rank function to create the following ranks for the original var
x
:
x average first last random max min
3 4.5 4 5 5 5 4
1 1.5 1 2 2 2 1
4 6.0 6 6 6 6 6
1 1.5 2 1 1 2 1
5 8.0 7 9 9 9 7
9 11.0 11 11 11 11 11
2 3.0 3 3 3 3 3
6 10.0 10 10 10 10 10
5 8.0 8 8 7 9 7
3 4.5 5 4 4 5 4
5 8.0 9 7 8 9 7
I am struggling to implement the
min
-version in MQL5. First, you probably need to sort the Array but you need to take care of the original order. How the ranks are assigned manually is quite logical but I have no clue how to implement this in MQL5.
Quote
Report
Post Reply
Checking account access…