/  Forum 


iberenhaus:
I'm using Bill Poulos's FOREX Profit Accelerator System and he mentions that that ADX in MT4 is calculated differently than ADX in other software. It certainly looks a lot different. Does anyone have code for ADX as implemented in VT Trader. There are two parameters rather than one  for example, ADX (14, 14). Looking at StockCharts.com, it appears that ADX typically has one parameter as in MT4. VT Trader seems highly regarded. I couldn't get the complete code from VT Trader, but did get the following (see below). The images below show Friday's EUR/USD charts from MetaTrader 4 and VT Trader. The ADX horizontal line is 16 in both cases. The horizontal lines for the ATR on both charts are 125, 150 and 175 pips. I would also appreciate it if you could confirm that the MT4 day ends and starts at 5 PM ET. Thanks. Your help would be appreciated. Thanks, Ira Berenhaus TH:= if(Ref(C,1)>H,Ref(C,1),H); TL:= if(Ref(C,1)<L,Ref(C,1),L); TR:= THTL;
PlusDM:= if(H>Ref(H,1) AND L>=Ref(L,1), HRef(H,1), if(H>Ref(H,1) AND L<Ref(L,1) AND HRef(H,1)>Ref(L,1)L, HRef(H,1), 0)); PlusDI:= 100 * Wilders(PlusDM,Pr)/Wilders(Tr,Pr);
MinusDM:= if(L<Ref(L,1) AND H<=Ref(H,1), Ref(L,1)L, if(H>Ref(H,1) AND L<Ref(L,1) AND HRef(H,1)<Ref(L,1)L, Ref(L,1)L, 0)); MinusDI:= 100 * Wilders(MinusDM,Pr)/Wilders(Tr,Pr);
DIDif:= Abs(PlusDIMinusDI); DISum:= PlusDI + MinusDI;
_ADX:= 100 * Wilders(DIDif/DISum,SmPr); Average Directional Movement Index (ADX) Overview The Average Directional Movement Index (ADX) is a momentum indicator developed by J. Welles Wilder and described in his book "New Concepts in Technical Trading Systems", written in 1978. The ADX is constructed from two other Wilders' indicators: the Positive Directional indicator (+DI) and the Negative Directional Indicator (DI). The +DI and DI indicators are commonly referred to as the Directional Movement Index. Combining the +/DI and applying a Wilders() smoothing filter results in the final ADX value. Interpretation The ADX's main purpose is to measure the strength of market trends on a 0100 scale; the higher the ADX value the stronger the trend. It should be noted that while the direction of price is important to the ADX's calculation, the ADX itself is not a directional indicator. Values above 40 indicate very strong trending while values below 20 indicate nontrending or ranging market conditions. Traders typically use the ADX as a filter along with other indicators to create a more concrete trading methodology. Many traders view ADX turning up from below 20 as an early signal of a new emerging trend while, conversely, a declining ADX turning down from above 40 as deterioration of the current trend. Wilder suggests using the ADX as part of a system that includes the +DI and DI indicators. (See the Directional Movement System indicator for additional details) Implementation Users can define the DMI Periods and the ADX Smoothing Periods to allow for full customization of the ADX indicator. Often times these values will be the set the same, but users are encouraged to experiment with a variety of their own combinations of values. A horizontal reference line is displayed at the +20 level. Hello, Have you have any answer on this? I have the same problem. 
28399 
See 'WildersDMI_v1'


28399 
Change 'WildersDMI_v1' as you need.


thanks for quick reply Rosh. how can change it to add or see for DX line.i do not have any idea. 
28399 
vici:
thanks for quick reply Rosh. how can change it to add or see for DX line.i do not have any idea. Try to change by similar way: #property indicator_separate_window #property indicator_buffers 5 #property indicator_color1 LightBlue #property indicator_width1 2 #property indicator_color2 Lime #property indicator_width2 1 #property indicator_style2 2 #property indicator_color3 Tomato #property indicator_width3 1 #property indicator_style3 2 #property indicator_color4 Orange #property indicator_width4 2 #property indicator_color5 Red #property indicator_level1 20 // input parameters extern int MA_Length =1; // Period of additional smoothing extern int DMI_Length =14; // Period of DMI extern int ADX_Length =14; // Period of ADX extern int ADXR_Length =14; // Period of ADXR extern int UseADX =1; // Use ADX: 0off,1on extern int UseADXR =1; // Use ADXR: 0off,1on // buffers double ADX[]; double PDI[]; double MDI[]; double ADXR[]; double sPDI[]; double sMDI[]; double STR[]; double DX[]; //++ // Custom indicator initialization function  //++ int init() { // indicators IndicatorBuffers(8); SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ADX); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,PDI); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,MDI); SetIndexStyle(3,DRAW_LINE); SetIndexBuffer(3,ADXR); SetIndexBuffer(4,sPDI); SetIndexBuffer(5,sMDI); SetIndexBuffer(6,STR); SetIndexBuffer(7,DX); SetIndexStyle(7,DRAW_LINE); 

NT4 EURUSD from 8808
I'm using Bill Poulos's FOREX Profit Accelerator System and he mentions that that ADX in MT4 is calculated differently than ADX in other software. It certainly looks a lot different. Does anyone have code for ADX as implemented in VT Trader. There are two parameters rather than one  for example, ADX (14, 14). Looking at StockCharts.com, it appears that ADX typically has one parameter as in MT4. VT Trader seems highly regarded. I couldn't get the complete code from VT Trader, but did get the following (see below).
The images below show Friday's EUR/USD charts from MetaTrader 4 and VT Trader. The ADX horizontal line is 16 in both cases. The horizontal lines for the ATR on both charts are 125, 150 and 175 pips.
I would also appreciate it if you could confirm that the MT4 day ends and starts at 5 PM ET. Thanks.
Your help would be appreciated.
Thanks,
Ira Berenhaus
iberenhaus@comcast.net
TH:= if(Ref(C,1)>H,Ref(C,1),H);
TL:= if(Ref(C,1)<L,Ref(C,1),L);
TR:= THTL;
PlusDM:= if(H>Ref(H,1) AND L>=Ref(L,1), HRef(H,1),
if(H>Ref(H,1) AND L<Ref(L,1) AND HRef(H,1)>Ref(L,1)L, HRef(H,1),
0));
PlusDI:= 100 * Wilders(PlusDM,Pr)/Wilders(Tr,Pr);
MinusDM:= if(L<Ref(L,1) AND H<=Ref(H,1), Ref(L,1)L,
if(H>Ref(H,1) AND L<Ref(L,1) AND HRef(H,1)<Ref(L,1)L, Ref(L,1)L,
0));
MinusDI:= 100 * Wilders(MinusDM,Pr)/Wilders(Tr,Pr);
DIDif:= Abs(PlusDIMinusDI);
DISum:= PlusDI + MinusDI;
_ADX:= 100 * Wilders(DIDif/DISum,SmPr);
Average Directional Movement Index (ADX)
Overview
The Average Directional Movement Index (ADX) is a momentum indicator developed by J. Welles Wilder and described in his book "New Concepts in Technical Trading Systems", written in 1978. The ADX is constructed from two other Wilders' indicators: the Positive Directional indicator (+DI) and the Negative Directional Indicator (DI). The +DI and DI indicators are commonly referred to as the Directional Movement Index. Combining the +/DI and applying a Wilders() smoothing filter results in the final ADX value.
Interpretation
The ADX's main purpose is to measure the strength of market trends on a 0100 scale; the higher the ADX value the stronger the trend. It should be noted that while the direction of price is important to the ADX's calculation, the ADX itself is not a directional indicator. Values above 40 indicate very strong trending while values below 20 indicate nontrending or ranging market conditions.
Traders typically use the ADX as a filter along with other indicators to create a more concrete trading methodology. Many traders view ADX turning up from below 20 as an early signal of a new emerging trend while, conversely, a declining ADX turning down from above 40 as deterioration of the current trend. Wilder suggests using the ADX as part of a system that includes the +DI and DI indicators. (See the Directional Movement System indicator for additional details)
Implementation
Users can define the DMI Periods and the ADX Smoothing Periods to allow for full customization of the ADX indicator. Often times these values will be the set the same, but users are encouraged to experiment with a variety of their own combinations of values. A horizontal reference line is displayed at the +20 level.
MT4 EURUSD from 8808
VT Trader EURUSD from 8808