ADX help

 

Can someone program this into MT4 indicator for me please, all MT4 ADX indicators I have seen use different way to calculate.

Directional Movement Index (DMI)

formula

1. The Directional movement:

If today's High is higher than yesterday's High then:

+DM = today's High - yesterday's High

If today's Low is lower than yesterday's Low then:

-DM = yesterday's Low - today's Low

If +DM is greater than -DM then:

-DM = 0

If +DM is less than -DM then:

+DM = 0

2. The true range:

True range is the largest of:

today's High - today's Low,

|today's High - yesterday's Close|, and

|yesterday's Close - today's Low|

3. Moving average of +DM, -DM and True Range:

+DMMA = exponential moving average of +DM

-DMMA = exponential moving average of -DM

TRMA = exponential moving average of True Range

4. The Directional Indicators:

+DI = +DMMA / TRMA

-DI = -DMMA / TRMA

5. Directional Index:

DX = |(+DI - (-DI))| / (+DI + (-DI))

6. The Average Directional Movement Index:

ADX = the exponential moving average of DX

resource codes

for(i=0; i<n; i++)

{

if(m_aHigh>m_aHigh)

aPDM=m_aHigh-m_aHigh;

if(m_aLow<m_aLow)

aNDM=m_aLow-m_aLow;

if(aPDM>0.0)&&((aNDM>0.0))

{

if(aPDM>aNDM)

aNDM=0.0;

else

aPDM=0.0;

}

da=fabs(m_aHigh-m_aLow);

db=fabs(m_aHigh-m_aClose);

dc=fabs(m_aLow-m_aClose);

dd=max(da,db);

aTR=max(dd,dc);

}

EMA(aPDM, p1, aPDMMA);

EMA(aNDM, p1, aNDMMA);

EMA(aTR, p1, aTRMA);

for(i=0; i<n-p1; i++)

{

if(aTRMA!=0.0)

{

m_aPDI=aPDMMA/aTRMA*100.0;

m_aNDI=aNDMMA/aTRMA*100.0;

}

if(m_aPDI!=-m_aNDI)

aADX=fabs(m_aPDI-m_aNDI)/(m_aPDI+m_aNDI);

}

EMA(aADX, p1, m_aADXMA);

for(i=n-p1-1; i>=0; i--)

m_aADXMA=m_aADXMA*100.0;

 

can anyone help or comment on this?

I have a great system that I have been trading live for a year now that I gain 50 pips / day and would like to share but MT indicator is not even close to the charts I have elsewhere. according to my other charting service the above posted parameters are how the indicator needs to be calculated. I have no programming knowledge or I would do it myself.

 

Let us investigate it.

donb01:
can anyone help or comment on this? I have a great system that I have been trading live for a year now that I gain 50 pips / day and would like to share but MT indicator is not even close to the charts I have elsewhere. according to my other charting service the above posted parameters are how the indicator needs to be calculated. I have no programming knowledge or I would do it myself.

Hi donb,

Thank you very much for sharing your live trading experiment.

I'll investigate the code.

 
codersguru:
Hi donb,

Thank you very much for sharing your live trading experiment.

I'll investigate the code.

Thank you for your time codersguru

if you can make this indicator, we need to be able to change the ADX and DI period settings for my system / strategy

Reason: