View Single Post
  #294 (permalink)  
Old 11-20-2008, 07:40 AM
ValeoFX's Avatar
ValeoFX ValeoFX is offline
Senior Member
 
Join Date: Jan 2006
Location: Johannesburg, South Africa
Posts: 1,357
ValeoFX is on a distinguished road
Quote:
Originally Posted by mladen View Post
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)
First of all Mladen my friend, you are just too brilliant for words!! Thank you for showing us the right way; much appreciate your experise.

Secondly, there are "so many versions" of Wilders DMI that I would respectfully ask you to point me to the correct one.

I have this one from iGorad to be found at: http://www.forex-tsd.com/227710-post147.html

Thanking you in advance.
__________________
"Risk comes from not knowing what you are doing" The Tao of Warren Buffett.

"Avoiding mistakes, makes people STUPID and having to be RIGHT, makes you OBSOLETE." Robert Kiyosaki.

Last edited by ValeoFX; 11-20-2008 at 07:51 AM.
Reply With Quote