Robustness Lab: Market Regime Indicator with Bias-Corrected Hurst, Efficiency Ratio, and Volatility
Info
The Robustness Lab: Market Regime Indicator with Bias-Corrected Hurst, Efficiency Ratio, and Volatility is a Indicator for MetaTrader 5 that plain rescaled-range hurst estimates are biased upwards on short windows. For example, on pure random data with 128 returns, they read around 0.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Robustness Lab: Market Regime Indicator with Bias-Corrected Hurst, Efficiency Ratio, and Volatility
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
Plain rescaled-range Hurst estimates are biased upwards on short windows.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.
Description & Settings
Related: GDS Renko Liquidity Sweep Lab: Price Action Analysis - another powerful indicator for MetaTrader 5 traders.
Plain rescaled-range Hurst estimates are biased upwards on short windows. For example, on pure random data with 128 returns, they read around 0.58, suggesting a trend that is not present. This indicator corrects for that bias.Also recommended: Arixis Backtest Robustness Analyzer - similar indicator with strong performance on MetaTrader 5.
How it Works
Hurst Exponent:
R/S is measured across several window sizes and compared to the Anis-Lloyd / Peters expected value for random data. The remaining offset is calibrated once on simulated noise, so random data reads close to 0.50. Even with correction, a 128-return estimate has a standard error of about 0.08, so it should be treated as context rather than a stand-alone signal.
Efficiency Ratio:
This measures the net move divided by the total path traveled over the period. A value of 0 indicates pure back-and-forth movement, while 1 indicates a straight line.
Volatility Percentile:
This shows where the current Average True Range (ATR) sits within its recent historical range.
Regime:
The indicator defines regimes as follows: trend when Hurst is at or above the upper level and the efficiency ratio is at or above its level; mean-reversion when Hurst is at or below the lower level; and noise otherwise.
On the Chart
Blue line: Bias-corrected Hurst, with indicator levels at 0.45, 0.50, and 0.55.
Gold line: Efficiency ratio. Dotted line: Volatility percentile.
Color strip at the bottom: Green indicates trend, orange indicates mean-reversion, and grey indicates noise.
Panel: Displays the current regime, Hurst exponent, efficiency ratio, and volatility state for M15, H1, H4, and D1 timeframes.
Inputs
The indicator includes inputs for the Hurst window (in returns), efficiency ratio period, ATR period, volatility lookback period, Hurst levels for trend and mean-reversion, the efficiency ratio level for trend detection, the number of bars to calculate, and an option to show the panel.
Notes
This indicator requires the RL_Common.mqh file, which should be placed in the MQL5\Include\RobustnessLab directory. This file is included with the download.
The indicator describes the recent past market behavior and does not predict future price movements.
The provided screenshot displays the EURUSD currency pair on the H4 timeframe, using data from a MetaQuotes demo account.
You may also like: Internal Bar Strength (IBS) Indicator - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property version "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#property indicator_separate_window
#property indicator_minimum 0.0
#property indicator_maximum 1.0
#property indicator_buffers 7
#property indicator_plots 4
#property indicator_level1 0.45
#property indicator_level2 0.50
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.