Older versions of MetaTrader would stack chart objects according to their name, so if an object was accidentally deleted (which happens quite often), the Indicator or EA could create it again and it would stay behind another chart object if that is where it belonged. This is no longer the case :( Objects are now stacked based on the order they appear within the code. The downside to this is when an object is deleted by mistake, it will be created again YES, but will appear on top of other objects. I build several items that show information on the chart. Some of these are to ALWAYS stay as background items. Can we go back to stacking objects based on their name? - or is there another way to have items stack correctly without having to delete and recreate them at every new tick?
For clarification I am referring to how objects appear on the chart (not how they appear in the object list). MetaTrader 5 handles this correctly as does older builds of MetaTrader4.
Thank you
Maybe ObjectSetInteger() with OBJPROP_BACK. See mql4 help with F1.
Thank you for responding angevoyageur
However, this gives option of background or foreground only. If a user needs to stack 3 or more objects, this won't help.
What would be nice is for the newer builds to work like the older MT4 builds and like the current MT5 in how chart objects are visually displayed.
Consistency in coding.
Thank you for responding angevoyageur
However, this gives option of background or foreground only. If a user needs to stack 3 or more objects, this won't help.
What would be nice is for the newer builds to work like the older MT4 builds and like the current MT5 in how chart objects are visually displayed.
Consistency in coding.
I can only suggest you to write to ServiceDesk, to make Metaquotes this suggestion.
or maybe ObjectSetInteger() with OBJPROP_ZORDER.
For the record, I tried ZORDER. No luck and I think I know why (see below).
I think we've got another bug here :( You don't have to write code to see it.
Do this. With the text tool put two text objects on a chart. Each different color (such as one black and one white).
Place one on top of other so that it partially covers the second text object.
Restart your platform. The objects magically switch stacking order!
Restart again and they switch back to original stacking order.
Continue restarting, an endless cycle of text switching their stacking order.
I lost two days playing with graphics. I have to say the quality of the graphic package is very poor. First, it is incomplete. Second, it is buggy.
Could someone tell us, which graphics objects are implemented, and which of their properties do work currently? Otherwise it is really pain to code with it, it is not even testing, it is like a blind shooting, and then snooping whether the target is bleeding from the place I was aiming, and then investigating the reason why it is not.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Older versions of MetaTrader would stack chart objects according to their name, so if an object was accidentally deleted (which happens quite often), the Indicator or EA could create it again and it would stay behind another chart object if that is where it belonged. This is no longer the case :( Objects are now stacked based on the order they appear within the code. The downside to this is when an object is deleted by mistake, it will be created again YES, but will appear on top of other objects. I build several items that show information on the chart. Some of these are to ALWAYS stay as background items. Can we go back to stacking objects based on their name? - or is there another way to have items stack correctly without having to delete and recreate them at every new tick?
For clarification I am referring to how objects appear on the chart (not how they appear in the object list). MetaTrader 5 handles this correctly as does older builds of MetaTrader4.
Thank you