I'm writing a dashboard that displays information from symbols across all other open charts.
If a chart is deleted or added, I need to resize the dashboard and remove/add the missing symbol/timeframes.
Rather than coding a resize, I figured it's better to just delete the panel and re-create it. However, calling Destroy() doesn't delete the panel on the chart.
I've checked the return value of OnDestroy() (true) and checked _LastError (0), so I don't know what's going on. The only difference I've seen between Destroy() with a value of 0 (REASON_REMOVE) and a value greater than 0 is that ChartIndicatorDelete() will get called when reason == REASON_REMOVE. Even then, I don't see how that would allow for the objects to be deleted.
BTW, I've worked around the issue by manually deleting the objects using ObjectsDeleteAll (for anyone looking to do the same: you also need to re-initialize the CAppDialog variable), but it irks me that the panel isn't deleted automatically when calling Destroy().
Thanks.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm writing a dashboard that displays information from symbols across all other open charts.
If a chart is deleted or added, I need to resize the dashboard and remove/add the missing symbol/timeframes.
Rather than coding a resize, I figured it's better to just delete the panel and re-create it. However, calling Destroy() doesn't delete the panel on the chart.
I've checked the return value of OnDestroy() (true) and checked _LastError (0), so I don't know what's going on. The only difference I've seen between Destroy() with a value of 0 (REASON_REMOVE) and a value greater than 0 is that ChartIndicatorDelete() will get called when reason == REASON_REMOVE. Even then, I don't see how that would allow for the objects to be deleted.
BTW, I've worked around the issue by manually deleting the objects using ObjectsDeleteAll (for anyone looking to do the same: you also need to re-initialize the CAppDialog variable), but it irks me that the panel isn't deleted automatically when calling Destroy().
Thanks.