Mean Deviation Index (MDI) by William Blau - Enhanced MT5 Indicator
Info
The Mean Deviation Index (MDI) by William Blau - Enhanced MT5 Indicator is a Indicator for MetaTrader 5 that ergodic mdi (mean deviation index) is a double-smoothed version of the mean deviation index. The mean deviation is defined as the distance between the closing price and an exponentially smoothed moving average (EMA) applied to the closing price.
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 Mean Deviation Index (MDI) by William Blau - Enhanced MT5 Indicator
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
Ergodic MDI (Mean Deviation Index) is a double-smoothed version of the Mean Deviation Index.
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: institutional equilibrium matrix for mean-reverting assets - another powerful indicator for MetaTrader 5 traders.
Ergodic MDI (Mean Deviation Index) is a double-smoothed version of the Mean Deviation Index. The mean deviation is defined as the distance between the closing price and an exponentially smoothed moving average (EMA) applied to the closing price.Also recommended: k-means machine learning for liquidity clusters - similar indicator with strong performance on MetaTrader 5.
The smoothing process introduces a lag, which can be observed at price reversal points. The value of the mean deviation indicates the distance between the price and an r-period moving average applied to the price.
The sign of the mean deviation shows the price's position relative to the r-period moving average: it is positive if the price is above the moving average and negative if the price is below the moving average.
Installation:
Place williamblau.mqh in the terminal_data_folder\mql5\include\ directory.
Place blau_mdi.mq5 in the terminal_data_folder\mql5\indicators\ directory.
Mean Deviation Index by William Blau
Calculation:
The mean deviation is calculated using the formula:
MD(price,r) = price - EMA(price,r)
Where:
price - Closing price.
EMA(price,r) - Market trend, determined by an exponentially smoothed moving average with period r, applied to the price.
The Mean Deviation Index is calculated using the formula:
MDI = EMA(EMA(MD(price,r),s),u)
Where:
price - Closing price.
EMA(price,r) - Market direction - the 1st EMA smoothing of period r, applied to the price.
MD(price,r) = price - EMA(price,r) - Mean Deviation.
EMA(MD(price,r),s) - 2nd smoothing - exponentially smoothed moving average of period s, applied to the mean deviation.
EMA(EMA(MD(price,r),s),u) - 3rd smoothing - exponentially smoothed moving average of period u, applied to the result of the 1st smoothing.
Input Parameters:
r - Period of the 1st EMA, applied to the price (default: r=20).
s - Period of the 2nd EMA, applied to the mean deviation (default: s=5).
u - Period of the 3rd EMA, applied to the result of the smoothing (default: u=3).
appliedprice - Price data to use (default: price_close).
Notes:
r > 1.
s > 0, u > 0. If r, s, or u = 1, smoothing is not applied.
Minimum rates required = (r + s + u - 3 + 1) = (r + s + u - 2).
You may also like: standard deviation (std dev) - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "robotfx"
#property link "https://robotfx.org"
#property description "this code is educational. feel free to use, modify and upgrade as you wish. visit robotfx.org for professional trading tools"
#include <williamblau.mqh> // include file (terminal_data_folder\mql5\include)
#property indicator_separate_window // indicator in a separate window
#property indicator_buffers 5 // number of buffers
#property indicator_plots 1 // number of graphic plots
#property indicator_label1 "mdi" // label of graphic plot #0
#property indicator_type1 draw_line // draw as a line
#property indicator_color1 blue // line color
.......
⚠ 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.