Raseri:
Try returning INIT_SUCCEEDED below your handle definition.
Hi. So I coded a basic EA and want to add an MA filter to it to see if it performs better. I'm running into an issue, though. When it tries to copy the values from the indicator to the array, it fails, with error code 4807 for invalid handle. The weird thing is, I check to make sure the handle isn't invalid right after it's initialized, and have the OnInit function return INIT_FAILED if it's invalid. So, the handle is for some reason becoming invalid between the OnInit and OnTick functions. Anyway, here's the relevant code if anyone wants to see it:
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
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
Hi. So I coded a basic EA and want to add an MA filter to it to see if it performs better. I'm running into an issue, though. When it tries to copy the values from the indicator to the array, it fails, with error code 4807 for invalid handle. The weird thing is, I check to make sure the handle isn't invalid right after it's initialized, and have the OnInit function return INIT_FAILED if it's invalid. So, the handle is for some reason becoming invalid between the OnInit and OnTick functions. Anyway, here's the relevant code if anyone wants to see it:
and in the OnTick function:
Any help would be appreciated.