Download MetaTrader 5

Change color of line dynamically

To add comments, please log in or register
selnomeria
254
selnomeria  

It is so hard to code to make the line (i.e. MyBuffer1) to have different colors while some conditions change...


How to do that? Is there any update?

whroeder1
15902
whroeder1  
You use two buffers with different colors. HOW CAN I hide CONNECTION lines of plots? (ttt) - MQL4 forum
selnomeria
254
selnomeria  

and what if i want use line with 3,4,5,6 different colors?


why wont MQL give a simplest simplest thing, like :    


if(myCond) {

   MyBuffer1[i].color = red;

}


or etc...

whroeder1
15902
whroeder1  
selnomeria: why wont MQL give a simplest simplest thing, l
  1. Because that's how they wrote it a decade plus years ago.
  2. This isn't Burger King - you don't get it your way. Live with it, or move on.
Mladen Rakic
61830
Mladen Rakic  
selnomeria:

and what if i want use line with 3,4,5,6 different colors?


why wont MQL give a simplest simplest thing, like :    


if(myCond) {

   MyBuffer1[i].color = red;

}


or etc...

In metatrader 4, if you want to draw multi color lines, you have to use additional 2 buffers for each additional color. If you don't (if you use only one buffer per additional color), you will get a repainting indicator

That condition is true if you want to draw muti color LINES. For other types of drawing styles you do not have to do that

whroeder1
15902
whroeder1  
Mladen Rakic: ou have to use additional 2 buffers for each additional color.
  1. No you need one buffer per color. You set all the others to empty. No repainting.
  2. Previously answered. See link in #1
To add comments, please log in or register