Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1523

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
Do you need to use the handle? There is a function that removes an indicator with the specified name from the specified chart window .
IndicatorDelete(int,const string) - Price Charts - Standard Library - MQL5 Reference - Reference Manual for MetaTrader 5 Algorithmic/Automated Trading Language for MetaTrader 5
Regards, Vladimir.
it works only in the indicator code or I don't know how to do it, please give me an example of adding and removing an alligator.
I think everything is very clearly commented out in the code. The first line of the code deletes the subwindow, and the second line deletes the indicator from the main window, you just need to correctly write the short name of the indicator to be deleted.
Regards, Vladimir.
This is if the indicator has a name, but if it is added by handle, it is not so simple
I don't understand, but what prevents you from writing (inserting) this short name in the code of the indicator you are using? For example, as it is done in the indicator code of Artyom Trishkin, only replacing the name "Net Volume" with some of your own:
Regards, Vladimir.
I don't understand, but what prevents you from writing (inserting) this short name in the code of the indicator you are using? For example, as it is done in the indicator code of Artyom Trishkin, but replacing the name "Net Volume" with some of your own:
Regards, Vladimir.
It is written in the indicator, not at the moment of its placement on the chart.
I'm interested in this question only now, when I looked through the documentation more carefully....
It turns out that there is no other way but with a double loop.
I got this...
Code
Result
So it turns out that if you need to loop through all the available indicators to reach the desired one by checking the handles and when you find it, just interrupt the loop and delete the indicator by this short name.
Another option, easier... If you know that the indicator is in the main window, then the cycle of searching indicator windows can be removed.
Here I have added an indicator programmatically
The result is as follows
I figured it out, I need to add this code to the place where I need to remove all indicators
Thank you very much, it is possible to remove all indicators before adding the EA to the chart from OnInit, as well as during deinitialisation in OnDeinit of the EA, it would be good to add an article on this subject. I envy your experience.
This is prescribed in the indicator, not at the moment of its placement on the chart.
Hi Alexey, I don't know, but I think I have described everything clearly and understandably in my message:
Forum on Trading, Automated Trading Systems and Testing Trading Strategies
Questions from MQL5 MT5 MetaTrader 5 beginners
MrBrooklin, 2024.04.20 05:04 AM
I don't understand, what prevents you from writing (inserting) this short name in the code of the indicator you are using? For example, as it is done in the indicator code of Artyom Trishkin, only replacing the name "Net Volume" with some of your own:
Regards, Vladimir.
I asked for the deletion code, not the function of renaming the indicator.
taking into account that there can be many indicators, the code of comrade Alexey Viktorov was more useful.
Vladimir.