Thread: MACD indicator
View Single Post
  #281 (permalink)  
Old 06-26-2009, 10:32 AM
ray_dl ray_dl is offline
Member
 
Join Date: Mar 2007
Location: shanghai
Posts: 39
ray_dl is on a distinguished road
Quote:
Originally Posted by mladen View Post
Lazy
Replace that code with this one :
PHP Code:
               for(i=0i<barsPerTimeFrame;i++,k++)
               {
                  
current ExtMapBuffer7[k]-ExtMapBuffer6[k];
                  
prev    ExtMapBuffer7[k+1]-ExtMapBuffer6[k+1];
                  if (((
current<0)&&(prev>0))||(current<0))   upfalse;    
                  if (((
current>0)&&(prev<0))||(current>0))   uptrue;  

                  
//
                  //
                  //
                                   
                  
ExtMapBuffer5[k] = ExtMapBuffer7[k]*koef;
                  
ExtMapBuffer6[k] = ExtMapBuffer6[k]*koef
It is what is called "it has everything, but at wrong place". Only the steps were in a wrong order, nothing else
Btw: those are, when you are writing the code, hardest to spot. When someone else looks at it, it is likely that he/she will spot it immediately . Once I lost 3-4 days just to find out that I need to invert 2 line position

regards
mladen
THANK YOU!
You are great!
Attached Files
File Type: mq4 All MACD v1[1].0 4 color.mq4 (13.8 KB, 84 views)
Reply With Quote