Forex
Google

Go Back   Forex Trading > Discussion Areas > Suggestions for Trading Systems
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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

Reply
 
LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 11-10-2005, 03:56 AM
donb01 donb01 is offline
Member
 
Join Date: Nov 2005
Posts: 53
donb01 is on a distinguished road
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;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-11-2005, 03:46 AM
donb01 donb01 is offline
Member
 
Join Date: Nov 2005
Posts: 53
donb01 is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-11-2005, 05:26 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Thumbs up Let us investigate it.

Quote:
Originally Posted by 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.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 11-13-2005, 04:07 AM
donb01 donb01 is offline
Member
 
Join Date: Nov 2005
Posts: 53
donb01 is on a distinguished road
Quote:
Originally Posted by 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

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


All times are GMT. The time now is 07:37 AM.