Hello everyone,
I stumble on a very weird behaviour when trying to get my EA to implement a custom indicator. As said in title, when hitting play, I get a new indicator window every time iCustom is called. Is this the expected result? iMA, iATR, iEnvelopes, etc don't have this behaviour.
iCustom implementation:
How can I prevent this?
I don't think it has anything to do with my indicator implementation since it works exactly the same way when copy/pasting the RVI indicator code inside a new file for example.
Thanks for your help!
Totally has to do with this: https://www.mql5.com/en/forum/296230/page3#comment_15320996
So basically, it is a better practice to declare your handler in the OnInit method, and then call iGetArray (that you can find here: https://www.mql5.com/en/forum/296230#comment_10034372 )
Thanks to @Vladimir Karputov for his work.
- 2020.03.05
- www.mql5.com
Hello everyone,
I stumble on a very weird behaviour when trying to get my EA to implement a custom indicator. As said in title, when hitting play, I get a new indicator window every time iCustom is called. Is this the expected result? iMA, iATR, iEnvelopes, etc don't have this behaviour.
iCustom implementation:
How can I prevent this?
I don't think it has anything to do with my indicator implementation since it works exactly the same way when copy/pasting the RVI indicator code inside a new file for example.
Thanks for your help!
are you sure that you are correctly using iCustom in OnInit() to get the handle of the indicator that you want to use?
are you sure that you are correctly using iCustom in OnInit() to get the handle of the indicator that you want to use?
Hi Paul, thanks for your answer. No I wasn't. I was using it directly on OnTick method, and that was the issue (as specified in my own answer)
Thanks for your help!
are you sure that you are correctly using iCustom in OnInit() to get the handle of the indicator that you want to use?
To create the indicator handle ONCE in OnInit is ABSOLUTELY CORRECT!
Please READ CAREFULLY: You will find on the MQL5 forum!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everyone,
I stumble on a very weird behaviour when trying to get my EA to implement a custom indicator. As said in title, when hitting play, I get a new indicator window every time iCustom is called. Is this the expected result? iMA, iATR, iEnvelopes, etc don't have this behaviour.
iCustom implementation:
How can I prevent this?
I don't think it has anything to do with my indicator implementation since it works exactly the same way when copy/pasting the RVI indicator code inside a new file for example.
Thanks for your help!