Download MetaTrader 5

indicator color coding - page 2

To add comments, please log in or register
Namthanduan Kahmei
Namthanduan Kahmei  

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

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)                                           
    if( sslup[i+1] == EMPTY_VALUE ) // start of up line
        ssldn[i] = sslup[i];        // join the lines
    //       if(dir[0]==1)          // unnecessary test, can only be up or down.
    if( ssldn[i+1] == EMPTY_VALUE ) // start of dn line
        sslup[i] = ssldn[i];        // join the lines

To add comments, please log in or register