Join our fan page
Mean Deviation Index Blau_MDI - indicator for MetaTrader 5
- Views:
- 7666
- Rating:
- Published:
- 2011.06.28 19:20
- Updated:
- 2016.11.22 07:32
- Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
Author: Andrey N. Bolkonsky
The Ergodic MDI (Mean Deviation Index, MDI) is the double-smoothed Mean Deviation Index (see Momentum, Direction, and Divergence: Applying the Latest Momentum Indicators for Technical Analysis).
The mean deviation is defined as a distance between close price and exponentially smoothed moving average, applied to close price.
- The smoothing leads to a lag, it can be seen at price reversal points. The value of mean deviation shows the distance between price and r-period moving average, applied to price.
- The sign of the mean deviation shows price position relative to r-period moving average, applied to price: it positive if price below the moving average and negative if price is lower than moving average.
- WilliamBlau.mqh must be placed in terminal_data_folder\MQL5\Include\
- Blau_MDI.mq5 must be placed in terminal_data_folder\MQL5\Indicators\
Mean Deviation Index by William Blau
Calculation:
The mean deviation is calculated by formula:
md(price,r) = price - EMA(price,r)
where:
- price - close price;
- EMA(price,r) - market trend, determined by exponentially smoothed moving average with period r, applied to price.
Mean Deviation Index is calculated by formula:
MDI(price,r,s,u) = EMA(EMA( md(price,r) ,s),u) = EMA(EMA( price-EMA(price,r) ,s),u)
where:
- price - close price;
- EMA(price,r) - market direction - 1st EMA smoothing of period r, applied to 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 mean deviation;
- EMA(EMA(md(price,r),s),u) - 3rd smoothing - exponentially smoothed moving average of period u, applied to result of the 1st smoothing;
- r - period of the 1st EMA, applied to price (by default r=20);
- s - period of the 2nd EMA, applied to mean deviation (by default s=5);
- u - period of the 3rd EMA, applied to result of the smoothing (by default u=3);
- AppliedPrice - price type (by default AppliedPrice=PRICE_CLOSE).
- r>1;
- s>0, u>0. If r, s or u =1, smoothing is not used;
- Min. rates=(r+s+u-3+1).
Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/373
Stochastic Momentum Oscillator by William Blau.
Stochastic Momentum Index Blau_SMIStochastic Momentum Index by William Blau.
Ergodic Mean Deviation Index (MDI) Oscillator by William Blau.
Moving Averages Convergence/Divergence Indicator Blau_MACDMoving Averages Convergence/Divergence Indicator by William Blau.