Nicola Grippaldi:
I tested the EA in https://www.mql5.com/en/docs/chart_operations/chartindicatoradd and works well.
Now I wish modify indicator's style/width/color, is there a way?
Thanks
Nicola
Short answer, yes.
Check on this page to get you started.
I tried this solution, but doesn't work
//+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { int indicator_handle=iMA(Symbol(),0,_period,_shift,MODE_SMA,apr); if(indicator_handle==INVALID_HANDLE) { Print("Failed to create MA indicator. Error code ",GetLastError()); return(INIT_FAILED); } bool added=ChartIndicatorAdd(0,0,indicator_handle); if(!added) { PrintFormat("Failed to add MA indicator on %d chart window. Error code %d", 0,GetLastError()); return(INIT_FAILED); } PlotIndexSetInteger(0,PLOT_LINE_STYLE,STYLE_DASHDOT); // <------------------------- does nothing return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { // Expert Advisor performs nothing }
Nicola Grippaldi:
You can't change indicator's style/with/color by "external" code, you can only do it within the indicator.
I tested the EA in https://www.mql5.com/en/docs/chart_operations/chartindicatoradd and works well.
Now I wish modify indicator's style/width/color, is there a way?
Thanks
Nicola
ok, thanks anyway
Add input parameters to indicator and then you can change them from external ea.
Amir Yacoby:
do you mean as custom indicator?
Add input parameters to indicator and then you can change them from external ea.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I tested the EA in https://www.mql5.com/en/docs/chart_operations/chartindicatoradd and works well.
Now I wish modify indicator's style/width/color, is there a way?
Thanks
Nicola