tak88js:
It seems improbable that the built-in function, used by thousands of people has, itself, a built-in divide by zero error. I would therefore suggest that your code surrounding the function call has an error. Post enough of the surrounding code and somebody may spot it for you.
I've been writing a Program that includes the iMACD -function, but whenever I tried to get a Signal of the MACD, I got the message: zero divide.
By finding the Problem I printed: iMACD(NULL,0,10,20,7,PRICE_MEDIAN,MODE_MAIN,1) only, and realized that whenever the MACD value get smaller, It will give me the message: zero divide.
dabbler:
It seems improbable that the built-in function, used by thousands of people has, itself, a built-in divide by zero error. I would therefore suggest that your code surrounding the function call has an error. Post enough of the surrounding code and somebody may spot it for you.
It seems improbable that the built-in function, used by thousands of people has, itself, a built-in divide by zero error. I would therefore suggest that your code surrounding the function call has an error. Post enough of the surrounding code and somebody may spot it for you.
Right!
The following line was at the end of my EA:
Print(iMACD(NULL,5,10,20,7,PRICE_CLOSE,MODE_MAIN,1));
Without the rest of the code there is no mistake.
So the Error is caused by another Function in the EA!? Because then I don't understand the relation of the Error to the Print-function.
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've been writing a Program that includes the iMACD -function, but whenever I tried to get a Signal of the MACD, I got the message: zero divide.
By finding the Problem I printed: iMACD(NULL,0,10,20,7,PRICE_MEDIAN,MODE_MAIN,1) only, and realized that whenever the MACD value get smaller, It will give me the message: zero divide.
So far I could find this Problem in calcuations only.
How can I solve this Problem and get a proper value of iMACD?