stringo wrote:
1. Try to analyze error code (GetLastError function)
2. Set ObjectsRedraw() as final line
1. Try to analyze error code (GetLastError function)
2. Set ObjectsRedraw() as final line
Tried both. No errors reported. ObjectsRedraw() doesn't help.
Any other ideas? Still struggling to make sense of handling objects here.

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
The code below is my attempt to delete all arrow objects on the chart which do not touch a price bar. When I comment out ..., the script accurately Prints all objects which do and do not match the criteria as expected. However, when I uncomment ObjectDelete, the arrow objects which should get deleted (e.g. the stragglers which do not touch a price bar) do not all get deleted. Rather, I need to click the script several times.
The screen shot below illustrates what I'm trying to accomplish. The first screen shot is with ObjectDelete(ObjectName(i)); commented out as seen in the code excerpt below. Notice how all stragglers get printed to screen correctly. The second screen is what I get after running the script with ObjectDelete... uncommented. Not all corresponding objects get deleted.
Please help me quickly delete all straggler arrows!
Second chart result with ObjectDelete code uncommented. Note that 2 out of the 3 objects actually get deleted.