|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack (1) | Thread Tools | Display Modes |
|
|||
|
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[i]>m_aHigh[i+1]) aPDM[i]=m_aHigh[i]-m_aHigh[i+1]; if(m_aLow[i]<m_aLow[i+1]) aNDM[i]=m_aLow[i+1]-m_aLow[i]; if(aPDM[i]>0.0)&&((aNDM[i]>0.0)) { if(aPDM[i]>aNDM[i]) aNDM[i]=0.0; else aPDM[i]=0.0; } da=fabs(m_aHigh[i]-m_aLow[i]); db=fabs(m_aHigh[i]-m_aClose[i+1]); dc=fabs(m_aLow[i]-m_aClose[i+1]); dd=max(da,db); aTR[i]=max(dd,dc); } EMA(aPDM, p1, aPDMMA); EMA(aNDM, p1, aNDMMA); EMA(aTR, p1, aTRMA); for(i=0; i<n-p1; i++) { if(aTRMA[i]!=0.0) { m_aPDI[i]=aPDMMA[i]/aTRMA[i]*100.0; m_aNDI[i]=aNDMMA[i]/aTRMA[i]*100.0; } if(m_aPDI[i]!=-m_aNDI[i]) aADX[i]=fabs(m_aPDI[i]-m_aNDI[i])/(m_aPDI[i]+m_aNDI[i]); } EMA(aADX, p1, m_aADXMA); for(i=n-p1-1; i>=0; i--) m_aADXMA[i]=m_aADXMA[i]*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. |
|
|||
|
Quote:
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 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/suggestions-trading-systems/308-adx-help.html
|
|||
| Posted By | For | Type | Date |
| Forex ADX Resources #6 | This thread | Refback | 08-02-2007 06:11 PM |