Download MetaTrader 5
To add comments, please log in or register
Publish your trading signal. Gain access to millions of traders!
Namthanduan Kahmei
178
Namthanduan Kahmei 2015.01.27 05:33  

introduced another indicator buffer

this will not be a drawing buffer

but only a calculation buffer

if calculation value is true,assign it to one drawing buffer,and you color your lien

if false,assign to the other drawing buffer and your line color change

whroeder1
13991
whroeder1 2015.01.27 12:53  
tenlau: Sorry, don't know how to "translate" in code your advice: "At a change in color, both buffers must have the same value."
  1.       dir[1]=dir[0];
    
    This doesn't work. After the initial fill, every tick you set dir[1]=dir[0], so dir[1] is useless. This is what MirFX means by "introduced another indicator buffer"
  2.       if(dir[0]==-1)                                           
    {
             sslup[i]=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
    if( sslup[i+1] == EMPTY_VALUE ) // start of up line
        ssldn[i] = sslup[i];        // join the lines
    }
          else                                                     
            {                                                      
    //       if(dir[0]==1)          // unnecessary test, can only be up or down.
                ssldn[i]=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW,i+1);
    if( ssldn[i+1] == EMPTY_VALUE ) // start of dn line
        sslup[i] = ssldn[i];        // join the lines
    

/ /12
To add comments, please log in or register