ADX indicator is wrong in Metatrader4?

 

Hello,

I´m a newbie to Metatrader and I don´t understand why I get different results for ADX in Metatrader platform for a given time period, as compared to the normal platform from my broker (Oanda). I also tried another platform (Fxpro) and I see exactly the same difference.

Please see the 2 files in attachment: the files have the same parameters, i.e., ADX30, EURUSD15mn, the same hour is selected (4 am in Metatrader, which is equivalent to 9 am in Lisbon Time), but nevertheless in MT4 DI- is above DI+, while in Oanda DI+ is above DI-, and the same happens in most of the following hours.

Does anyone know why this happens?

Thank you,

 ADX OandaADX OandaMetatrader

 

Looks to me two different indicators

With Oanda you see the values displayed

With FxPro  there is only  ADX(30)  in the separated chart displayed no values  and 3 lines in separate chart

On the right the values are also different

    with Oanda no digits  with FxPro 2 digits 

Maybe you can bring the indicator of Oanda to the FxPro account (change name ADX in for example ADX2 )

and put that in the same chart 

 

Hi deVries,

Thank you for your answer.

In my above message the top chart is Oanda´s standard platform, the bottom chart is Oanda´s Metatrader platform.

You can see 3 lines in the top chart because I chose the blue colour for the ADX main line, while in the bottom chart (Oanda´s Metatrader platform) I chose the white colour, so it blurs with the white background.

 

In order to compare with another broker, I downloaded Fxpro standard platform and Fxpro Metatrader4 and you can see the same kind of difference in ADX for the same time period between the two platforms.

 

The following chart is ADX in FxPro standard platform: 

 Fxpro_ADX

 

The following chart is ADX in Fxpro Metatrader4: 

 Fxpro ADX_Metatrader

 

 

 If you compare the performance of ADX both in Oanda´s standard platform and in Fxpro standard platform, you can see that it is almost identical. Here follow both charts:

 

ADX chart in Oanda´s standard platform (now I chose black for the main colour, so only 2 lines are visible):

ADX Oanda´s standard platform 

 

 ADX chart in Fxpro Standard platform: 

 ADX_Fxpro standard platform

 

 And if you compare the performance of ADX both in Oanda´s MT4 and Fxpro MT4, you can see that they are identical. Here follow both charts:

 ADX Oanda Metatrader

 Fxpro ADX_Metatrader

 

 So, it seems that ADX is very different in MT4 and I don´t understand why. I believe it is the same indicator: it has the same name (ADX - Average Directional Movement Index), same main, DI+ and DI- lines...

Can you think of some reason why this would happen?

(Sorry for my ignorance,  I don´t know how I can bring the indicator of Oanda to the FxPro account and put that in the same chart) 

 Thank you so much for your patience!

 
PS72: So, it seems that ADX is very different in MT4 and I don´t understand why. 

Per Average directional movement index - Wikipedia, the free encyclopedia +DI = 100 times exponential moving average of +DM divided by average true range

Per Average Directional Movement Index, ADX - MQL4 Code Base

PlusSdiBuffer[i]=100.0*pdm/tr; MinusSdiBuffer[i]=100.0*mdm/tr;

Mq4 uses true range of the bar. Not average true range.



 
WHRoeder :

Per Average directional movement index - Wikipedia, the free encyclopedia +DI = 100 times exponential moving average of +DM divided by average true range

Per Average Directional Movement Index, ADX - MQL4 Code Base

Mq4 uses true range of the bar. Not average true range.



 

Hi WHRoeder,

Thank you for your help! Could you help me change the code, in order to obtain the same ADX as in the standard Oanda and Fxpro platforms?

I don´t know much about mql4 coding, I tried changing the value of tr into atr, using i(ATR), it compiles ok but no result comes out of that, I only get a blank chart. I inserted the following code into the ADX code and erased tr, but I know something is wrong.

   double period_atr;
   double atr;
   
   period_atr=14;
     
   atr=iATR(NULL,0, period_atr,0);
     
   else      { PlusSdiBuffer[i]=100.0*pdm/atr; MinusSdiBuffer[i]=100.0*mdm/atr; }
     

I´d really appreciate any idea of how to change this code correctly.

Thank you

 
PS72 : I know something is wrong.

I´d really appreciate any idea of how to change this code correctly.

  1. Do you really expect an answer when all you show is several snippets of code and not everything you changed? There are no mind-readers here.
  2. You are computing PlusSdiBuffer[i] maybe you should compute the ATR of the same bar
     atr=iATR(NULL,0, period_atr, i);