Thank you for your reply. They are from another indicator which displays an on-screen price grid of XX pips depending upon the timeframe. The objects created are in the background, the rectangle is created in the foreground (although I've done testing with them in the background too).
The weird thing is as I said, they don't interfere when the indicator is first dropped on the chart, or when a rectangle label is manually drawn on the chart. Executions of ChartRedraw() do not interfere either. But as soon as a candle closes, its a mess.
Thanks for the help. Here is what I learned:
1) On initialization, indicators are executed from the bottom of the indicator list up. However, this execution order is not predictable when ticks or new bars are drawn.
2) Deleting and re-creating the rectangle object I want on top does solve the color problem, but not the execution order problem for new ticks or new bars.
3) Remembering both indicators are only redrawing their objects on a new candle and not for every tick, the solution was to have the offending indicator set a global variable which, if it exists, the indicator painting the rectangle would fully process the first tick after the tick that drops a new bar, and delete the global variable. While I do have to wait for an incoming tick after a new candle to fix the graphical issue, this is acceptable. This assures one tick away cleanup of the graphical problem whenever the offending indicator redraws its background objects.
Silly, but that's the only solution I could devise given our apparent inability to control the *visual* zorder of the objects.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
Somethings seems buggy with an OBJ_RECTANGLE_LABEL. I have the same problem whether the object is drawn manually in the trade station or created programmatically in an indicator.
A background object from another indicator is causing the color of the rectangle to vary when it is overlaid on the background object.
The rectangle looks fine until a new candle posts on the chart, then the background object beneath it changes the color of the rectangle where the two objects share the same space in the chart.
Same problem if the rectangles are set to background or not.
Experimentation with zorder on the rectangle created in MQL doesn't change the behavior.
Deleting and re-creating the object in the indicator code doesn't change the problem.
Calls to ChartRedraw() are not the cause, as I can cause the ChartRedraw() to execute before a new candle posts on the chart and the display remains fine (zooming, scrolling, etc). It only screws up when a new candle is posted on the chart.
When the indicator is first dropped on the chart it looks fine. Then the manual rectangle is first drawn it looks fine. However, as soon as a new candle posts the display is interfered with by the underlying object in the background.
In the image below you will see the large gold and salmon areas to the left are properly displayed when the indicator is first dropped on the chart. The right-most rectangle was drawn on the chart manually, and initially looked fine, but you can see the color interference after a new candle was posted. The large gold and salmon areas get the same problem once a new candle posts on the chart.
Is this a graphical bug, or does someone know of a solution. Kind of sucks.....
Here is what it looks like after a new candle posts on the chart after the indicator was dropped....
ANY ideas would be GREATLY appreciated!
Thanks in advance,