Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1934
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
Artyom, I probably didn't quite understand, maybe I asked the question wrongly:
There are three (four, five...) man-made objects (ObjectCreate). The first one hides behind the third one, the second one is in the foreground,. How to set one to foreground, second to second, third to background. So that the first object is always visible, the second one is always visible but not behind the first one. The third object is also always visible, but not behind the first and the second. A kind of alternating plan.
I just didn't quite understand about the TF.
Take turns doing as described above for each of your objects. The alternation will affect the layout. The very last one to which this action will be applied will be the topmost one.
Once you have determined that any graphical object that should be below your objects has appeared on the graph, alternately do a hiding-display for each of your objects (as I wrote above). This action brings the object to the foreground of the graphic. Your first object to which this action was applied will be at the bottom (but above any other graphical object drawn on the chart after your objects have been created), the second will be above the first, the third will be above the first and second, and so on. All objects that have been hid-overed will be above the rest of the graphical objects.
That is, the order in which the hiding-objects are applied to your objects sets their order above each other. But they will all appear above everything else on the graph.
The logic is this:
If any graphical object appears on the graph that shouldn't overlap your objects, you do a hiding-display for each of your objects in the order in which they should visually appear (first at the very bottom, last at the very top). After hiding-displaying all your objects do ChartRedraw().
This is important - redraw the chart only after all your objects have been hidden-displayed, so that visually there is no flickering on the chart.
Take it in turns to do as described above for each of your properties. The rotation will affect the positioning. The most recent object to which this action is applied will be the uppermost.
Once you have determined that any graphical object that should be below your objects has appeared on the graph, alternately do a hiding-display for each of your objects (as I wrote above). This action brings the object to the foreground of the graphic. Your first object to which this action was applied will be at the bottom (but above any other graphical object drawn on the chart after your objects have been created), the second will be above the first, the third will be above the first and second, and so on. All objects that have been hid-overed will be above the rest of the graphical objects.
That is, the order in which the hiding-objects are applied to your objects determines their order above each other. But they will all appear above everything else on the graph.
The logic is this:
If any graphical object appears on the graph that shouldn't overlap your objects, you do a hiding-display for each of your objects in the order in which they should visually appear (first at the very bottom, last at the very top). After hiding-displaying all your objects do ChartRedraw().
This is important - redraw the chart only after all your objects have been hidden-displayed, so that visually there is no flickering on the chart.
Kindly, one more thing: changed from 2k monitor to 1080 laptop and all the text became too big and overlapped each other. Please advise how to solve this problem
It's more complicated than that. You need to use resources to output graphics. Read TextSetFont() - this is about font size in logical pixels.
Accordingly TextOut() - about text output from the resource. You can find everything about this in the links in the documentation.
It's more complicated than that. You need to use resources to output graphics. Read TextSetFont() - this is about font size in logical pixels.
Accordingly TextOut() - about text output from the resource. And all about it - via links in documentation.
Got it! Thanks a lot.
Please, one more thing: I switched from a 2k monitor to a 1080 laptop and all the text became big and overlapped each other. Please advise how to solve this problem
With the help of the Windows. Graphics setting large small font should also adjust.
What if there are two monitors? Different ones...
What if there are two monitors? Different...
Help optimise the indicator. The indicator works but slowly, it takes a very long time to optimise the EA with it. Please advise what has been done wrong? How to speed up its work?
Help optimise the indicator. The indicator works but slowly, it takes a very long time to optimise the EA with it. Please advise what has been done wrong? How to make it work faster?
This is not the way it is done. Just pay attention to this line
//| Copyright © 2004, MetaQuotes Software Corp. |
The programming language has changed so much in 18 years that it should not work at all. I don't understand why MQ still hasn't disabled int init() and int start() altogether