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 usually clear the handle and the calculation part in OnDeinit and everything is removed. The object is not an indicator.
https://www.mql5.com/ru/docs/chart_operations/chartindicatordelete
"Removing an indicator from a chart does not mean that the calculation part of the indicator will also be removed from the terminal memory. To release the indicator handle, use IndicatorRelease() function."
Yes, Vladimir, I've already done that and written about it before, but the result is still the same.
Regards, Vladimir.
Forum on trading, automated trading systems and strategy testing
New trading robot
MrBrooklin, 2020.09.28 10:38
I have been solving this problem for more than an hour. I wanted to create and display ZigZagColor indicator on the chart at the Expert Advisor startup. It was done in int OnInit:
The indicator was created and displayed. Now I need the indicator to be deleted after the Expert Advisor is removed. I am writing it:
But the indicator is not removed. I have sorted everything out. I have cleaned the handle and applied the delete function. I wonder what is the reason why it is not uninstalling.
Regards, Vladimir.
Remove the indicator from the chart with the function
ChartIndicatorDelete(
long chart_id, // chart ID
int sub_window // number of the subwindow
const string indicator_shortname // short indicator name
);
Thanks, Alexey, I will try it with a clear head tomorrow, I'm already confused by the information I've got. As they say, I'll sleep better in the morning!
I now have another thing that puzzled and surprised me a lot. I tried to clear the chart with the script developed by Vladimir Karputov, but this script deleted absolutely everything except for the custom indicator ZigzagColor! Tried to remove a simple ZigZag with the same script, it doesn't remove either! It's a mystery...
Regards, Vladimir.
Thanks, Alexey, tomorrow I'll try it with a clear head, as I'm already in a mess of information. As the saying goes - wiser in the morning!
Now there is another thing that puzzled me a lot and surprised me. I tried to clear the chart with the script developed by Vladimir Karputov, but this script deleted absolutely everything except for the custom indicator ZigzagColor! Tried to remove a simple ZigZag with the same script, it doesn't remove either! It's a mystery...
Regards, Vladimir.
Try this script
short name ZigzagColor - and this is the default, if you set it differently you need to write those digits
and that's exactly what you need to put in
short name ZigzagColor - and this is the default, if you set it differently you need to write those digits
and that is how it should be spelled
or you can change the indicator itself - give a simpler name
for example
-----------------------------------------------
i already showed you the script - if this script is attached to a chart and you don't give an indicator name, it will work without deleting any indicator - but it will write in the Expert Advisor window which indicators are available
https://c.mql5.com/3/332/IndicatorDelete.mq5
This is what I have
Try this script
Good day everyone!
Aleksey, I have applied your script. I got error code 4115. I found what it means in the handbook:
ERR_CHART_INDICATOR_CANNOT_DEL
4115
Error when deleting the indicator from the chart
Regards, Vladimir.
or you can also change the indicator itself by giving it a simpler name
like this
-----------------------------------------------
I have already downloaded the script - if this script is attached to a chart and you do not give an indicator name it will work without deleting any Indicator - but it will write in the Expert Advisor window which Indictors are present
https://c.mql5.com/3/332/IndicatorDelete.mq5
This is what I have!
Hello! I have implemented your script. Two indicators appeared in the Experts tab : Volumes and ZigZag (80,20,0). It is indeed so, only the ZigZag indicator is written without Color for some reason.
Regards, Vladimir.
Try this script
Good day everyone!
Aleksey, applied your script. I got error code 4115.
Regards, Vladimir.
I have to be more careful.
Indicator name and indicator short name often do not coincide.
Hello! I have applied your script. Two indicators appeared in the Experts tab: Volumes and ZigZag (80,20,0). It is indeed so, only the ZigZag indicator is written without Color for some reason.
Sincerely, Vladimir.
So, you have to write it like this - ZigZag (80,20,0).
It will definitely be deleted in this case.
-----------------
but withoutColor
because this is how it is written in the indicator
You have to write it like this - ZigZag (80,20,0)
The ZigZag will definitely be deleted.
-----------------
but withoutColor
because this is how it is written in the indicator
If you change the settings, you need to add those numbers that you have specified in the Indicator
for example