-
double diff[1];
Diff has only one element. What do you expect happens when i becomes one? You would know that if you had used strict.Always use strict. Fixing the warnings will save you hours of debugging.
-
iClose(symbol1,1440,i)
Don't hard code numbers, use the appropriate enumeration. -
iMAOnArray(diff,0,ma_zscore,0,MODE_SMA,i)
ma_zscore has no values. What do you expect? - iMAOnArray requires your array to be filled out (but you are counting up) and you need to set as-series before filling.

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
Hello everyone, I am new to programming with mql4, and I want to program an indicator that shows me the z-score of the differential between two instruments, in this case I enclose all the code I have for the differential between AUDUSD and NZDUSD with the image where the error about "zero divide in" appears.