Oh. Well I was referring to the fact, he is using ObjectDelete inside an EA, deleting Objects from another Indicator, not specifically referring to a custom indicator to which he has the handle available within the EA....
So, yes, it could mislead when stating "... see on screen".
Sorry for the confusion.
Edit:
Besides the code being inside the indicator creating the objects itself. The intention was more in pointing to the whole concept of ChartID and windows in general.
Dominik Egert: May I know your findings around ChartID?
Thank you for Advice. I read that Articles, But i Said it again. I try my code with ChartID, 0 and Symbol() and nothing different between them. all of the method worked perfectly when i use it in the OnInit or OnCalculate. But When i use in OnDeinit nothing happens and the Object Only remove when i Close my Indicator from H1 Time frame.
It should make no difference what the chart time-frame is when the indicator is deleted.
If the objects are not being removed then they are not named beginning with "Line"
I know it But not work. one of the attachment image is part of my code create the objects and other for the time i close indicator from D1 time frame. As you can see the Object remain have Line in the name
I know it But not work. one of the attachment image is part of my code create the objects and other for the time i close indicator from D1 time frame. As you can see the Object remain have Line in the name
Please show the full OnDeinit function that you are currently using. Don't forget to use the code button when pasting code.
Don't edit or change the OnDeinit function, post it exactly as you are using.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Your code assumes that there will always be an object named "Line0".
If there isn't the code will not be executed.
Also anytime the object is not found the loop will exit. So if there is not an object named "Line4", "Line5" etc will not be deleted.
You would be better off to use
Your code assumes that there will always be an object named "Line0".
If there isn't the code will not be executed.
Also anytime the object is not found the loop will exit. So if there is not an object named "Line4", "Line5" etc will not be deleted.
You would be better off to use
thank you this is the easiest way and worked.
but still is worked only when indicator close from H1 time frame and if indicator close from another one the object still remain.
I do not understand why this is happand.but still is worked only when indicator close from H1 time frame and if indicator close from another one the object still remain.
It should make no difference what the chart time-frame is when the indicator is deleted.
If the objects are not being removed then they are not named beginning with "Line"
May I know your findings around ChartID?
Thank you for Advice. I read that Articles, But i Said it again. I try my code with ChartID, 0 and Symbol() and nothing different between them. all of the method worked perfectly when i use it in the OnInit or OnCalculate. But When i use in OnDeinit nothing happens and the Object Only remove when i Close my Indicator from H1 Time frame.
It should make no difference what the chart time-frame is when the indicator is deleted.
If the objects are not being removed then they are not named beginning with "Line"
I know it But not work. one of the attachment image is part of my code create the objects and other for the time i close indicator from D1 time frame. As you can see the Object remain have Line in the name
I know it But not work. one of the attachment image is part of my code create the objects and other for the time i close indicator from D1 time frame. As you can see the Object remain have Line in the name
Please show the full OnDeinit function that you are currently using. Don't forget to use the code button when pasting code.
Don't edit or change the OnDeinit function, post it exactly as you are using.
Please show the full OnDeinit function that you are currently using. Don't forget to use the code button when pasting code.
Don't edit or change the OnDeinit function, post it exactly as you are using.