If the objects are created manually, or by several indicators, or you don't have the source then loop through all the objects in the subwindow using ObjectsTotal(). The second parameter is for subwindow and the third parameter is for object type.
If the objects are only made by one indicator, and you have the source, then change the code in the indicator.
![ObjectsTotal - Object Functions - MQL4 Reference ObjectsTotal - Object Functions - MQL4 Reference](https://c.mql5.com/36/11/objectstotal-object-functions-mql4.png)
- docs.mql4.com
How can I change the color of every LabelValue/Lines in Indicator (SubWindow)?
ObjectSetInteger()
If the objects are created manually, or by several indicators, or you don't have the source then loop through all the objects in the subwindow using ObjectsTotal(). The second parameter is for subwindow and the third parameter is for object type.
If the objects are only made by one indicator, and you have the source, then change the code in the indicator.
I used SetLevelValue() to put lines in my indicator in subwindow. There's no option to change color per different level.
Can you please give sample code?
Read (Editor F1 => search-tab) about IndicatorSetInteger(.., INDICATOR_LEVELCOLOR, ...
=> "Color of the level line, color sets color for all levels"
Read (Editor F1 => search-tab) about IndicatorSetInteger(.., INDICATOR_LEVELCOLOR, ...
=> "Color of the level line, color sets color for all levels"
I tried that it don't work, it didn't change the color of indicators lines. Maybe something wrong in my code.
IndicatorSetInteger(INDICATOR_LEVELCOLOR, 5, clrRed);
Can you please give me sample code.
I tried that it don't work, it didn't change the color of indicators lines. Maybe something wrong in my code.
IndicatorSetInteger(INDICATOR_LEVELCOLOR, 5, clrRed);
Can you please give me sample code.
That will not work with mt4 - mt4 allows only one color for all levels (it will use the last color for levels that you try to set)
It works with mt5
In any case you shall have to have the following line too :
If you want to see the 6th level too ("5" in those function calls means 6th level)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
How can I change the color of every LevellValue/Lines in Indicator (SubWindow)?
Edit: I used SetLevelValue() to put indicator lines in my indicator (SubWindow).