Errors, bugs, questions - page 2794
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
My indicator has started to lose graphical objects for some reason and does not delete them. I use automatic deletion in class destructor. I call it:
As a result, I get a false positive. I call GetLastError() and get error 4101 ("Errory chart identifier"). Suppose. I compare the chartID of the graphical object being deleted with the ChartID() function result and they are exactly the same. What can be the reason for not removing an object from the chart and how can I get around it?
I have decided to try another way. When creating a chart, I add all objects to the list and use the loop to delete all objects when deleting the indicator. Now functionGetLastError() gives error 4001 after ObjectDeletefunction call and some chart objects stay on the chart.
My indicator started losing graphical objects for some reason and won't delete them. I use automatic deletion in class destructor. I call it:
As a result, I get a false positive. I call GetLastError() and get error 4101 ("Errory chart identifier"). Suppose. I compare the chartID of the graphical object being deleted with the ChartID() function result and they are absolutely the same. What may be the reason for not removing an object from the chart and how can it be avoided?
Actions to demonstrate the bug.
1. place the indicator on the chart.
2. Remove the indicator from the chart.
3 Press Ctrl+B, then press the "List all" button in the window and see the objects that have not been removed.
I have only 294 out of 100000.
If you reduce the value of input parameter nBars, the bug does not appear.
Good afternoon.
I've been stalling for a long time with upgrading from Windows 7 to 10, but I reinstalled this week.
Now I have a problem, I can't download Expert Advisor demo versions of my indicators and other EAs,
I hit download button and nothing happens, I tried it with opened and closed terminal!
I am trying to download it for MT4 terminal, I haven't been to MT5 yet.
What the hell is going on?
Made a source code where this bug occurs:
What happens when a pointer is deleted?
Is there a command to the graph to delete the graphical object? See note to ObjectDelete
I have as many as 294 out of 100000.
If we decrease the value of input parameter nBars, the bug doesn't occur.
Can it happen that the loop lasts longer than it takes to execute OnDeinit?
In your example all objects have prefix "trend", why don't you use it and refuse from the loop?
What happens when a pointer is deleted?
Is there a command to the graph to delete the graphical object? See the note on ObjectDelete
I've certainly thought about this note before. But then I decided for some reason that it was a bug of the terminal. For which I apologize. So it must be my fault.
But I do not know what to do in this case. Do I call ObjectDelete and then ObjectFind and wait until it fails to find out if the object was actually removed? Judging by the same note, it's too time consuming. I do not know if a second deletion will work (in my indicator I have tried to call ObjectDelete twice in a row, but it did not work). And the Sleep function in indicators doesn't work to give the chart some time to delete each object. Perhaps there are examples somewhere on how to get around this?
Can't it happen that the loop lasts longer than the time allowed to execute OnDeinit?
After all, all objects in your example have "trend" prefix, why not use it and refuse from the loop?
This is only in the example. The indicator I am working with has complex names. And I gave an example just for demonstration purpose.
I certainly thought about this note before. But then for some reason I thought it was a terminal bug. For which I apologise. It turns out to be my fault.
But I do not know what to do in this case. Do I call ObjectDelete and then ObjectFind and wait until it fails to find out if the object was actually removed? Judging by the same note, it's too time consuming. I do not know if a second deletion would work (in my indicator I tried to call ObjectDelete twice in a row, but it did not work). And the Sleep function in indicators doesn't work to give the chart some time to delete each object. Perhaps there are examples somewhere of how to get around this?
I think you add all pointers to the list. Terminal subsystem itself deletes such objects, pointers to which are in CArrayObj list
After the terminal is shut down, objects remain on the chart after the indicator. And when I start the terminal again, these objects are visible and spoil the whole view.
After the terminal is shut down, objects remain on the chart after the indicator. And when I start the terminal again, these objects are visible and spoil the whole view.