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 am trying to delete some chartobjects that I created. I am doing this in the onDelete().
There are 3 objects...
1. A rectangle
2. The other two are trend object.
The two trend objects successfully gets deleted and removed from the chart.
The rectangle is confirmed to be deleted but it stays on the chart...
I need help to get the rectangle object to stop showing on the chart after it has been deleted.
Here are a few things I have tried
1. I tried to change the chart background to black ... hoping it will repaint and overide the rectangle... it does notwork.
2. I changed the color of the rectangle to the same color as the background of the chart and then delete the rectangle. This works but this is just a hack...and unnecessary extra coding... I think there should be a better way to erase objects that have been deleted on the chart. I am also curious why the behaviour of RECTANGLE chartsObject is different from TREND ChartObject even though they are both from the same class library of MQL5.
Here is the function that I wrote to delete it. I call this function in the onDelete function of the EA;