Modify Moving Average Color Style

 

Guys please help to modify Moving Average Style Color using MQL5.

i want to change the color from default RED to AQUA in a single 1 click button.

iMA(_Symbol,PERIOD_CURRENT,60,0,MODE_EMA,PRICE_CLOSE);

additional art to my EA. tnx

 
MikelDavao:

Guys please help to modify Moving Average Style Color using MQL5.

i want to change the color from default RED to AQUA in a single 1 click button.

additional art to my EA. tnx

EA cannot change indicator's color directly.

And to do that indirectly, you need to have the source code of the indicator, and one way is to expose it's color as an input parameter.

 
Seng Joo Thio:

EA cannot change indicator's color directly.

And to do that indirectly, you need to have the source code of the indicator, and one way is to expose it's color as an input parameter.

thanks for the effort. i want to change because when iCustome is in use in my code with 3MA it shows color RED all indicator in the chart.

i put a tricks using below

ObjectSetInteger(0,"Moving Average()",OBJPROP_COLOR,clrBlack);

and change my mode into smiley.lol

other search say, its ok to use this one

#property indicator_type1   DRAW_COLOR_LINE        //<<-- find this
#property indicator_color1  clrRed,clrLime,clrBlue //<<-- this is the code for the color
#property indicator_style1  STYLE_SOLID            //<<-- find this

after compile nothing happen

XAUUSD M1 2020-03-10 7:21:00

 
Michael Quinatadcan Macasil Macasil #:

thanks for the effort. i want to change because when iCustome is in use in my code with 3MA it shows color RED all indicator in the chart.

i put a tricks using below

and change my mode into smiley.lol

other search say, its ok to use this one

after compile nothing happen

XAUUSD M1 2020-03-10 7:21:00

Hi, I found solution here.

Actually you can't change style of indicators by EA.

You can save a template of your strategy and use LoadTemplate(ChartID, "template.tpl") to apply styles to your chart with only one line of code.