View Single Post
  #291 (permalink)  
Old 11-19-2008, 09:13 PM
mladen's Avatar
mladen mladen is online now
Senior Member
 
Join Date: Oct 2006
Posts: 1,275
mladen is on a distinguished road
...

All one need to do (in the case of ADX_CrossesNonrepainting) is to add two lines of code :
PHP Code:
    for(int i 0limiti++)
      {
        
b4plusdi iADX(NULL0ADXcrossesPeriodPRICE_CLOSEMODE_PLUSDI1);
        
nowplusdi iADX(NULL0ADXcrossesPeriodPRICE_CLOSEMODE_PLUSDIi);
        
b4minusdi iADX(NULL0ADXcrossesPeriodPRICE_CLOSEMODE_MINUSDI1);
        
nowminusdi iADX(NULL0ADXcrossesPeriodPRICE_CLOSEMODE_MINUSDIi);  
        
//----
        
ExtMapBuffer1[i] = EMPTY_VALUE;  // this line added
        
ExtMapBuffer2[i] = EMPTY_VALUE;  // this line added too
        //----        
        
if(b4plusdi b4minusdi && nowplusdi nowminusdi)
            
ExtMapBuffer1[i] = Low[i] - nShift*Point;
        
//----
        
if(b4plusdi b4minusdi && nowplusdi nowminusdi)
            
ExtMapBuffer2[i] = High[i] + nShift*Point;
      } 
That is the "clean up". Nothing else does not have to be done
Since the "if block" is not always going to assign value, the corresponding buffer must be cleaned before the "if block" (otherwise there is a risk of repainting)

PS: when using ADX, do not forget that metatrader ADX is not equal to Wilders DMI (the original)
Reply With Quote