Exp_SpearmanRankCorrelation_Histogram
This EA uses the Spearman Rank Correlation indicator displayed as a histogram to identify statistically significant correlation shifts between price series and rank-ordered data. It generates trade signals when the correlation histogram crosses predefined threshold levels, entering positions on mean-reversion logic when correlation diverges from normal ranges. The strategy aims to capitalize on temporary statistical anomalies that tend to revert to their mean correlation value.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
This EA builds its trading strategy on the Spearman Rank Correlation coefficient, a non-parametric statistical indicator measuring the strength of monotonic relationships between two variables. Entry conditions trigger when the correlation histogram value crosses predefined upper or lower thresholds — going long when crossing above the upper threshold and short when crossing below the lower threshold, embodying the mean-reversion core idea that correlation deviations from normal levels are expected to revert. Exit conditions rely on reverse signals or fixed stop-loss/take-profit levels, closing positions profitably when correlation reverts from extreme values. Position sizing uses a fixed lot approach without dynamic position adjustment mechanisms. Money management lacks risk-proportion control, relying solely on the user manually setting reasonable trade volumes. The overall strategy concept has a statistical foundation but lacks protection against market structure changes and correlation breakdowns.
Strengths
- Built on the statistically rigorous Spearman Rank Correlation with mathematical theory backing; the non-parametric method is more robust to outliers
- Histogram format visually displays correlation changes, making it intuitive to assess market conditions
- Mean-reversion logic performs well in ranging markets, capturing trading opportunities from statistical anomalies
Weaknesses
- Mean-reversion strategy sustains continuous losses in trending markets; cannot effectively handle correlation breakdowns
- Lacks dynamic position sizing and risk-proportion control; fixed lot size cannot adapt to different account sizes and market volatility
- Default stop-loss and take-profit are zero, exposing the trader to unlimited loss risk if not manually configured
Possible improvements
- Add adaptive threshold mechanism that dynamically adjusts correlation thresholds based on market volatility, preventing frequent false entries in trending markets
- Add position sizing module that dynamically calculates lot size based on account balance and ATR, and set default stop-loss/take-profit values
Risk assessment
Overall risk: Medium
- Default stop-loss and take-profit values are zero; without manual configuration, single-trade losses can expand indefinitely
- Mean-reversion strategy builds consecutive counter-trend positions during strong trending markets, causing cumulative losses
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
InpRankCorrelationPeriod | 14 | Spearman rank correlation calculation period |
InpThresholdUp | 0.8 | Upper threshold, correlation above = long signal |
InpThresholdDown | -0.8 | Lower threshold, correlation below = short signal |
InpLotSize | 0.1 | Fixed trading lot size |
InpStopLoss | 0 | Stop loss in points, 0 means no stop loss |
InpTakeProfit | 0 | Take profit in points, 0 means no take profit |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.