Custom Code from MQL4 to MQL5
-
How to make this code works for ex5 EAs?
" double zz_temp_value = 0;
var_zz_H0_ID = 0;
var_zz_H1_ID = 0;
var_zz_H2_ID = 0;
var_zz_L0_ID = 0;
var_zz_L1_ID = 0;
var_zz_L2_ID = 0;for (int i = 0; i < zz_ID_interval; i++)
{
zz_temp_value = iCustom(Symbol(),zzTF,"ZigZag",zzDepth,zzDeviation,zzBackstep,0,i);
if (zz_temp_value == var_zz_H0) var_zz_H0_ID = i;
if (zz_temp_value == var_zz_H1) var_zz_H1_ID = i;
if (zz_temp_value == var_zz_H2) var_zz_H2_ID = i;
if (zz_temp_value == var_zz_L0) var_zz_L0_ID = i;
if (zz_temp_value == var_zz_L1) var_zz_L1_ID = i;
if (zz_temp_value == var_zz_L2) var_zz_L2_ID = i;
}"
-
iCustom works in a very different way in MQL5. You can compare the definition of this function in the documentation of MQL4 and MQL5. But it is pain in the butt to make iCustom to work in MQL5 in a similar was as in MQL4.
-
Yes, man. It is very different. I'm using ZigZag to draw Fibonacci retracement correctly. For Mt4 it is working fine. For MT5 I can't even draw the fibo. With the same EA, but with some modifications.
Btw, I'm using @miro1360 arcticle "ZigZag Advanced" as main engine.
-
I suggest you to read all the comments too, they may contain an interesting reply: