View Single Post
  #282 (permalink)  
Old 11-19-2008, 11:24 AM
mladen's Avatar
mladen mladen is online now
Senior Member
 
Join Date: Oct 2006
Posts: 1,276
mladen is on a distinguished road
ADX crossing

Be careful with it.
PHP Code:
for (shift CountBarsshift>=0shift--) 

    
b4plusdi=iADX(NULL,0,ADXbars,PRICE_CLOSE,MODE_PLUSDI,shift-1);
    
nowplusdi=iADX(NULL,0,ADXbars,PRICE_CLOSE,MODE_PLUSDI,shift);
    
b4minusdi=iADX(NULL,0,ADXbars,PRICE_CLOSE,MODE_MINUSDI,shift-1);
    
nowminusdi=iADX(NULL,0,ADXbars,PRICE_CLOSE,MODE_MINUSDI,shift); 
if (
b4plusdi>b4minusdi && nowplusdi<nowminusdi)
{
    
val1[shift]=Low[shift]-5*Point;
}
if (
b4plusdi<b4minusdi && nowplusdi>nowminusdi
{
    
val2[shift]=High[shift]+5*Point;
}

It is looking for future values (the shift-1 parameter) to find out crossings
Reply With Quote