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 pass these object properties explicitly (ANCHOR_RIGHT_UPPER, CORNER_RIGHT_UPPER):
I think I've got it. Did you show a sample function, not a working piece of code?
That's it, I'm taking the weekend off. Sorry for the interruption :)
A better version of this function, but something can be tweaked (in general, I would implement all this as an object, or several objects).
Although, you can put the function in a library and use it however you want.
A better version of this function, but something can be tweaked (in general, I would implement all this as an object, or several objects).
Although, you can put the function in a library and use it however you want.
(That's nice.)). What is the advantage of using this function as an object? For now I have implemented everything in the form of functions. Maybe I follow the wrong way and will have to redo everything later?
Well, why all of them. A function could be made more universal and packed into, say, a library.
Classes have advantages too, but these are tricks related to OOP (the main task will be to use the code in various projects without thinking about the implementation).
Example
As I see from the screenshot, you have something like an information panel (maybe some other functionality), so you can consider this panel as a number of unrelated objects (graphics, text, etc.), or you can view them as objects connected by one class. Thus, if you change one "input" parameter "Corner", this change will affect all that relates to the panel.
It is the same with the binding to the chart. By specifying a chart to the class, we indicate this chart to all objects controlled by the class as well.
Well, why all of them. A function could be made more universal and packed into, say, a library.
Classes have advantages too, but these are tricks of OOP (the main task will be to use the code in various projects without thinking about the implementation).
Example
As I see from the screenshot, you have something like an information panel (maybe some other functionality), so you can consider this panel as a number of unrelated objects (graphics, text, etc.), or you can view them as objects connected by one class. So if you change one "input" parameter "Corner", this change will affect all that relates to the panel.
I have the same problem with the binding to the chart. Once we indicate a chart to the class, we indicate this chart and all objects that this class controls.
You have a very remarkable ability. Explain everything very clearly in a couple of lines. Thank you. ))
After I get acquainted with all the functions I need and practice using them, I'll start to study the structures, classes and OOP. It's a pity that nature forces me to go to bed sometimes. I have to crawl away from the computer. ))
I have written this script:
Task: remove all objects of type OBJ_LABEL from the chart. But some are skipped and remain. An error is written in the logbook:
Please tell me how to do it correctly.
I have written such a script:
The task: delete all objects of OBJ_LABEL type from a chart. But some of them are skipped and remain. An error is written in the log:
Please advise how to do it correctly.
It seems to me that the loop should be descending rather than ascending, although I haven't gone into details (but since MQL4 the deletion of orders has been done in a descending loop).
The trick is that if you start deleting from large indexes then the original list won't change, except for deleting selected item (from the tail of the list)...
It seems to me that the cycle should be descending rather than ascending, although I haven't gone into details (since MQL4, orders are deleted in a descending cycle).
The trick is that if we start deleting from a large index then the original list won't change, except for deleting a selected item (from the tail of the list)...
I have tried to start the cycle from the end:
Now there are no errors in log, but not a single object is deleted).
Tried to start the cycle from the end:
Now there are no errors in the logbook, but no objects are deleted either.)
In quadruplet, I use this approach: all objects are groups, the name part is common in the group.
Deleting
for different groups
and here function IgorM
***
( just in case ) Sorting by ObjectName(not sure if it is relevant for 5)