JosephRael:
I'm writing an EA that uses momentum for trading. For this I use 4 indicators in pairs of 2. Pair one evaluates for example H1, the second pair M10. I'm using the iMA() function to init it, see the code below. But when running, the second pair both return invalid handles. What am I doing wrong here? (Please assume all the used variables are initiated prior to this.
use _LastError to see why your handles are invalid... most probably internal parameters are wrong
Create your handles in OnIinit. use them in OnTick.
Code2219 or probably 2319:
As you can see, that is already in there. The error message simply reads: "Failed to create a handle: 4002". Not much to go by unfortunately. I think I'll just build a quick MA algo myself and call that instead.
use _LastError to see why your handles are invalid... most probably internal parameters are wrong
JosephRael:
As you can see, that is already in there. The error message simply reads: "Failed to create a handle: 4002". Not much to go by unfortunately. I think I'll just build a quick MA algo myself and call that instead.
error codesAs you can see, that is already in there. The error message simply reads: "Failed to create a handle: 4002". Not much to go by unfortunately. I think I'll just build a quick MA algo myself and call that instead.
which means at least one of the parameters passed to iMA is wrong :
myP2 p2LargeTrendPeriod p2LargeTrendSMAMethod
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'm writing an EA that uses momentum for trading. For this I use 4 indicators in pairs of 2. Pair one evaluates for example H1, the second pair M10. I'm using the iMA() function to init it, see the code below. But when running, the second pair both return invalid handles. What am I doing wrong here? (Please assume all the used variables are initiated prior to this.