Hi,
I am very new to MetatTrade programming.
I have the following problem: I want to create an indicator that when counts 5 candles in a row with close > close t-1 print a 5 over the max of the candle and a 6, 7 etc for each subsequent candle (if it is the case).
It is just an simplified example but it gives you an idea of what I need :-)
The problem I have found is that it seems relatively easy to print an arrow or a symbol from Wingsdings, but difficult to print a number or a string.
The only way I found is using ObjectCreate which does the job but on the other hand it leaves the problem of deleting all those numbers (objects) when I remove indicator from a chart (numbers got stuck in the chart forever)
Is there any simple way to do that? Is there a way to add numbers to the Wingsdings table maybe?
Sorry if the question is trivial but I have been stuck for long now...
Thanks
Enrico
Have you tried searching with google?
https://www.mql5.com/en/forum/137397
- 2012.01.07
- www.mql5.com
Is there any simple way to do that?
Try https://www.mql5.com/en/docs/objects/objectdeleteall
int ObjectsDeleteAll( long chart_id, // chart ID const string prefix, // prefix in object name int sub_window=-1, // window index int object_type=-1 // object type );
Just name everything with the same prefix and Bob's your uncle.
Try https://www.mql5.com/en/docs/objects/objectdeleteall
Just name everything with the same prefix and Bob's your uncle.
I tried that solution too. But not sure where should I put that piece of code in order to be triggered when I delete an indicator from a chart (I manage to get it right when I modify time-frame for instance, but when i delete indicator all text objects remain on the chart).
So my problem stands
I tried that solution too. But not sure where should I put that piece of code in order to be triggered when I delete an indicator from a chart (I manage to get it right when I modify time-frame for instance, but when i delete indicator all text objects remain on the chart).
So my problem stands
OnDeinit() didn't work for you?
I think I understood what I was doing wrong. It was not working in debugging (because of course it was killing the debug process) but it is working in production.
So thank you very much and sorry for the 'silly' question
Enrico
I think I understood what I was doing wrong. It was not working in debugging (because of course it was killing the debug process) but it is working in production.
So thank you very much and sorry for the 'silly' question
Enrico
Don't be sorry for asking after trying to resolve it by yourself. Often we get blinded by trying to solve the issue and fail considering a broader POV
- 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 am very new to MetatTrade programming.
I have the following problem: I want to create an indicator that when counts 5 candles in a row with close > close t-1 print a 5 over the max of the candle and a 6, 7 etc for each subsequent candle (if it is the case).
It is just an simplified example but it gives you an idea of what I need :-)
The problem I have found is that it seems relatively easy to print an arrow or a symbol from Wingsdings, but difficult to print a number or a string.
The only way I found is using ObjectCreate which does the job but on the other hand it leaves the problem of deleting all those numbers (objects) when I remove indicator from a chart (numbers got stuck in the chart forever)
Is there any simple way to do that? Is there a way to add numbers to the Wingsdings table maybe?
Sorry if the question is trivial but I have been stuck for long now...
Thanks
Enrico