Check the method
Wilder and Exponential give different values even with the same period.
Adds ADXR to ADX and ±DI, and lets you check the smoothing method and the DI and ADX periods separately.
Look at blue, green and redBlue is ADX, green is +DI and red is −DI. The values change with the method.
Orange is ADXRThe current ADX plus the ADX a specified number of bars ago, divided by 2.
Conditions for comparing with the standardCheck Wilder or Exponential and the DI and ADX periods.
Compares the default settings and a settings change example on a screen with only this product applied.
Example shown: 1-minute chart (M1). This is an example to explain the display. The settings change example is not a recommended value. Details can be checked in the full-size view. The vertical axis of the separate window is adjusted automatically for each image, so do not compare values by on-screen height alone.
Wilder and Exponential give different values even with the same period.
Unlike the standard, which takes 1 period, the 2 periods can be set separately.
The orange line is the average of the current ADX and the ADX r bars ago. It is not a moving average or a future value.
A 4-line display that selects the same calculation family as the standard while adding separate periods and an average with past ADX.
The default method. The smoothing of DM and TR and the way ADX starts are matched to the MT5 standard ADX Wilder.
The exponentially smoothed type with the same formula as the MT5 standard ADX. Setting the DI period and ADX period equal allows comparison with the standard at the same period.
The DI period controls ±DI, and the ADX period controls the smoothing of DX. An ADX with separate periods is not assumed to equal the standard, which has only 1 period.
(current ADX+ADX r bars ago)/2. r is the distance back in the past to refer to, not a smoothing period.
Start from Wilder 14, 14, 14.
For Wilder, use ADX Wilder; for Exponential, use ADX. Align the periods too.
Change DI and ADX separately and check which lines change.
Set the number of bars you want to refer back to. If the line is not needed, use 0.
| Included file | Purpose / location |
|---|---|
| TRI_DMI_ADXR.ex5 | The MT5 main file. Place it in MQL5/Indicators. |
The ZIP contains only 1 item, the main file. The manual is opened from the product page on the site. Source code is not included. MT5 only; registration, account authentication and placing a license file are not required. Use it without changing the file name.
Extract the ex5 main file rather than leaving it in the compressed file.
In MT5, open MQL5/Indicators from 'File → Open Data Folder' and place the included ex5 there.
Refresh the Navigator or restart MT5, and apply it to the target chart. Place only 1 instance of the same product on 1 chart.
First check with the default values. Changes and removal are done from the chart's 'Indicators List'.
This product does not require DLL permission or enabling automated trading. When removed, this product's drawings are cleared.
There are 4 inputs. Change them on the Inputs tab of the properties window. The English display names are shown together with the input names in the code.
InpMethodInpDiPeriodInpAdxPeriodInpAdxrPeriodDI period n, ADX period m, ADXR distance r. ±DI starts from bar n+2 counted from the oldest with Wilder, and from bar n+1 with Exponential. ADX starts from bar n+m+1, and ADXR from bar n+m+r+1.
With 14, 14, 14, ±DI starts from the 16th bar, ADX from the 29th bar and ADXR from the 43rd bar. With r=0, the orange line is not displayed.
Values on the forming bar change. There are no notification or order functions.
This manual describes adding 1 instance of this product to 1 chart. To compare different settings, use separate charts.
This product shows calculation results through plot buffers and does not place trade orders. It does not guarantee profit or future price movement.
Check that ADXR Period is not 0 and that the required history is available.
This is because the smoothing method and initial values differ. Do not compare by period alone.
Align the method of the comparison target, DI = ADX period, and the history range. An ADX with separate periods and the additional ADXR differ from the standard 3 lines.
DI and ADX are 1 to 500, and ADXR is 0 to 500. Check the English message in the Experts tab.
If the first display does not appear, check history loading and the input ranges. If an earlier display has stopped updating, first check the price feed and the terminal's connection status.
With the oldest bar as index 0, DM and TR start with the simple average of indexes 1 to n and are updated with the coefficient 1/n. ADX starts with the simple average of DX at indexes n+1 to n+m and is updated with 1/m. Ratios with a zero denominator are 0.
The DM/TR ratio of each bar is smoothed with 2/(n+1) to get DI, and DX is smoothed with 2/(m+1) to get ADX. The ADX period is m.
Under the conditions compared with the standard ADX Wilder (ADX and ±DI with Wilder and DI = ADX = 14 and 120, and ±DI with DI 10 and ADX 20), the values match. With Exponential and DI = ADX = 14 and 120, the 3 lines also match the standard ADX. This is not a guarantee of equality for all markets and all settings.
With r>0, it is a simple 2-point average of ADX and the ADX r bars ago. It is not r−1 bars ago. Changing the method also changes the underlying ADX.