Hi,
I have spent a frustrating few hours attempting to rename an Rectangle object from a class function call inside the OnEvent.
I can get all the data from the created object and the build a new rectangle they way I want it. I then need to delete the original. But I can't. Even if I use DeleteAllObjects, it removes all object apart from the one in the Create event.
I have tried even setting a bool global variable for deletion outside of the main OnChartEvent, but that also would not work. My final thought was to let a tick go by and call a delete from OnCalculate but that just sounded absurd. So how do I end the relationship with the OnChartEvent and this rectangle object, so that I can delete it?
What's the error code returned by ObjectDelete() ?
Return Value
Returns true if the removal was successful, otherwise returns false. To read more about the error call GetLastError().
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I have spent a frustrating few hours attempting to rename an Rectangle object from a class function call inside the OnEvent.
I can get all the data from the created object and the build a new rectangle they way I want it. I then need to delete the original. But I can't. Even if I use DeleteAllObjects, it removes all object apart from the one in the Create event.
I have tried even setting a bool global variable for deletion outside of the main OnChartEvent, but that also would not work. My final thought was to let a tick go by and call a delete from OnCalculate but that just sounded absurd. So how do I end the relationship with the OnChartEvent and this rectangle object, so that I can delete it?