hi
I want to delete all indicators from my chart by running a piece of code in my expert or script
but it doesnot work properly .
some times delete one from 5 indicators, some times 2 .
and also it has delay!!!
please help me what can I do to insure the proper answer from metetrader
also I have error : 0 in expert tab for all indicators !!
you can see a sample report from expert tab in attached pic.
one custom indicator has been deleted by 15s delay!!
metatrader 's indicator ( AO) did not deleted !!
.
THIS IS A BUG IN METATRADER.
HOW CAN I REPORT THIS BUG ?!
can anybody help me ?
i have reported a bug 7 years ago throu Service Desk . but now I cannot !

- www.mql5.com
Hello
I'm sorry, my help will not be very great
there may be a problem getting the function to return, which could explain the high delay of 15 seconds.
The indicators you are trying to close may not have exclusive access and cannot be closed.
It will further lengthen the delay, but in this case, I think you should replace your "for" loop with a "while"
If there is a solution, it should be in preparation for clearing these flags, such as removing handles
Sorry, for not being able to do more
Have you tried counting loop in reverse? When removing things it is better to do so. Because of the FIFO nature of the queue.
Have you tried counting loop in reverse? When removing things it is better to do so. Because of the FIFO nature of the queue.
thank you very much . great hint
I had encountered this problem and used this solution a few years ago, when I want to delete market watch's symbols. but ...
now it works very nice
Hello
I'm sorry, my help will not be very great
there may be a problem getting the function to return, which could explain the high delay of 15 seconds.
The indicators you are trying to close may not have exclusive access and cannot be closed.
It will further lengthen the delay, but in this case, I think you should replace your "for" loop with a "while"
If there is a solution, it should be in preparation for clearing these flags, such as removing handles
Sorry, for not being able to do more
thank you very much for consultation
Mr yashar Seyyedin 's hint solved the problem , that is a good lesson for a programmers,
although I think MT4 's response was iregullar and strange .
If it's MT4, then post in MT4 section. Moved.
Anyway, this is not a bug in the platform. Fix your code and understanding.
string ind_name; int kmax,pmax; kmax=WindowsTotal(); for(int k=kmax-1; k>=0; k--) { pmax=ChartIndicatorsTotal((long)0,k); for(int p=pmax-1; p>=0; p--) { ind_name=ChartIndicatorName((long)0,k,p); if(!ChartIndicatorDelete((long)0,k,ind_name)) { Print(ind_name); Print("error : ",_LastError); } } }
you know , beside counting loop in reverse , I should add typecasting zero to the long in main 3 function of this program !!!
othervise it doesnot work properly and each time only delete one indicator !!
could you please tell the reason ?

- 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 want to delete all indicators from my chart by running a piece of code in my expert or script
but it doesnot work properly .
some times delete one from 5 indicators, some times 2 .
and also it has delay!!!
please help me what can I do to insure the proper answer from metetrader
also I have error : 0 in expert tab for all indicators !!
you can see a sample report from expert tab in attached pic.
one custom indicator has been deleted by 15s delay!!
metatrader 's indicator ( AO) did not deleted !!
.