MQL4 - automated forex trading   /  

Forum

Read Financial Magazines in MetaTrader 4 and MetaTrader 5!

ADX of MT4 doesn't give same result as ADX of VT Trader

Back to topics list To post a new topic, please log in or register
avatar
3
iberenhaus 2008.08.10 21:25
 


NT4 EUR-USD from 8-8-08

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:= TH-TL;

PlusDM:= if(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),

if(H>Ref(H,-1) AND L<Ref(L,-1) AND H-Ref(H,-1)>Ref(L,-1)-L, H-Ref(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 H-Ref(H,-1)<Ref(L,-1)-L, Ref(L,-1)-L,

0));

MinusDI:= 100 * Wilders(MinusDM,Pr)/Wilders(Tr,Pr);

DIDif:= Abs(PlusDI-MinusDI);

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 0-100 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 non-trending 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 EUR-USD from 8-8-08


VT Trader EUR-USD from 8-8-08

 
MetaTrader 4 Working under Antiviruses and Firewalls

MetaTrader 4 Working under Antiviruses and Firewalls

The most of traders use special programs to protect their PCs. Unfortunately, these programs don't only protect computers against intrusions, viruses and Trojans, but also consume a significant amount of resources. This relates to network traffic, first of all, which is wholly controlled by various intelligent antiviruses and firewalls. The reason for writing this article was that traders complained of slowed MetaTrader 4 Client Terminal when working with Outpost Firewall. We decided to make our own research using Kaspersky Antivirus 6.0 and Outpost Firewall Pro 4.0.

avatar
1
manelito 2009.01.05 23:20 #
 
iberenhaus:


NT4 EUR-USD from 8-8-08

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:= TH-TL;

PlusDM:= if(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),

if(H>Ref(H,-1) AND L<Ref(L,-1) AND H-Ref(H,-1)>Ref(L,-1)-L, H-Ref(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 H-Ref(H,-1)<Ref(L,-1)-L, Ref(L,-1)-L,

0));

MinusDI:= 100 * Wilders(MinusDM,Pr)/Wilders(Tr,Pr);

DIDif:= Abs(PlusDI-MinusDI);

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 0-100 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 non-trending 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 EUR-USD from 8-8-08


VT Trader EUR-USD from 8-8-08

Hello,

Have you have any answer on this? I have the same problem.

avatar
Moderator
28340
Rosh 2009.01.06 08:36 #
 
avatar
3
vici 2009.04.27 17:17 #
 

dear rosh,


i need full adx dmi indicator set like adx,adxr,dx,di+,di- all five of them like in metastock.

standart mt4 has 3 of them. dmi that you post it above has four of them.


thanks


vici

 
avatar
Moderator
28340
Rosh 2009.04.27 17:22 #
 
Change 'WildersDMI_v1' as you need.
avatar
3
vici 2009.04.27 17:57 #
 
Rosh:
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.

 
avatar
Moderator
28340
Rosh 2009.04.27 21:11 #
 
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: 0-off,1-on
extern int       UseADXR    =1; // Use ADXR: 0-off,1-on
//---- 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);
avatar
3
vici 2009.05.12 11:10 #
 

thanks rosh


i did modify as you show


but i get red just flat line for DX.

so it is not good to trade.

please help.

 
Back to topics list  

To add comments, please log in or register