Change the color of Technical Indicator

 

hi experts,

I want to use 3 iMA indicators in my code and I want to set different color to them.
How can I achieve this ?. This is how I start in OnInit() :

thank you

..
..
int OnInit()
  {
//--- create timer
   EMA10Definition=iMA(_Symbol,_Period,9,0,MODE_EMA,PRICE_CLOSE) ;
   EMA50Definition=iMA(_Symbol,_Period,22,0,MODE_EMA,PRICE_CLOSE) ;
   EMA100Definition=iMA(_Symbol,_Period,53,0,MODE_EMA,PRICE_CLOSE) ;
   
   ChartIndicatorAdd(0,0,EMA10Definition);
   ChartIndicatorAdd(0,0,EMA50Definition);
   ChartIndicatorAdd(0,0,EMA100Definition);
..
..
..
    


How cna I chgange teh color of 

 
Robobiee: hi experts, I want to use 3 iMA indicators in my code and I want to set different color to them. How can I achieve this ?. This is how I start in OnInit() : thank you How cna I chgange teh color of 
Currently, as far as I know, it is not possible to change the appearance (via MQL) of indicators added to the chart programmatically.
 
Fernando Carreiro #:
Currently, as far as I know, it is not possible to change the appearance (via MQL) of indicators added to the chart programmatically.
It's not possible through direct mql functions. But you can work around it with a template, not trivial, but if it's really needed...
 
Alain Verleyen #:
It's not possible through direct mql functions. But you can work around it with a template, not trivial, but if it's really needed...

Thank you Alain. Is there an example of template usage ?

Thank you

 
Fernando Carreiro #:
Currently, as far as I know, it is not possible to change the appearance (via MQL) of indicators added to the chart programmatically.
Thank you .
 
Robobiee #:

Thank you Alain. Is there an example of template usage ?

Thank you

I will not search or do it for you, please do your home work.

What I can do is give some details about the concept :

1- Place the indicators on your chart, as you did.

2- Save a template.

3- Tweak the template to set the colors, or whatever you want to change.

4- Apply the template.

You will need to take into account that applying a template will reset your running code. If you are not an experiment coder you will probably struggle a bit.

 
Alain Verleyen #:

I will not search or do it for you, please do your home work.

What I can do is give some details about the concept :

1- Place the indicators on your chart, as you did.

2- Save a template.

3- Tweak the template to set the colors, or whatever you want to change.

4- Apply the template.

You will need to take into account that applying a template will reset your running code. If you are not an experiment coder you will probably struggle a bit.

Thank you Alain