Spearman Rank Correlation - Floating Levels - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources




Typically, when Spearman's scale is used, it is combined with some fixed levels that, once crossed, should indicate a high "strength" of correlation (positive or negative, it doesn't matter). This version is Spearman's rank correlation, which adds floating levels instead of using fixed levels as a measure of high or low correlation ratios.

Non-parametric (distribution-free) ranking statistics were proposed by Spearman in 1904 as a standard variable to measure the strength of ties between two countries (Lyman and Dabrera 1998). The Spearman rank correlation coefficient can be used to give a reestimate and is a measure of monotonic association. Using the coefficient is undesirable or misleading when the distribution of the data is such that the Pearson correlation is undesirable.
The Spearman rank correlation coefficient is defined as

The difference is that in the statistical ranking of the corresponding variables, is the approximate coefficient of the exact correlation.
You can use color changes as signals.
PS: A "big picture" example may illustrate why floating levels seems to increase estimates when using Spearman rankings.
Attachment download
📎 spearman_rank_fl.mq5 (9.85 KB)
Source: MQL5 #22966
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •