I want to use classes inherited from CChartObject (Metaquotes standard
library). For example, I want my script to draw a trend line by using CChartObjectTrend class. But the parent class
(CChartObject) destructor contains deleting the object. That means when the script is ended the trend line is deleted (by parent
destructor) from the chart. That doesn't make me a sense. Could I change this behaviour? I'm not sure but I don't think so because I can't
disable calling of the parent destructor and I neither can override the parent destructor. Or do I miss something? Of course, I can copy and
paste the code and then write my own destructor (without deleting an object) but I want to try finding another solution. Could somebody help
me? Is there any possibility to disable deleting an object by the parent class destructor?
- Destructors
- Inheritance
- Self-reference: this
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