EA Handle Problem
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:
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
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.