You can not return an array. Pass the array in by reference.
MatlabCoder98:
i wrote a function to give a vector [ z1...z10] of zigzag index of any forex currency in function output.
but it show error in compliation.
'ZigArray' - invalid array access Ztest.mq4 93 12
that ZigArray is my required vector with 8 elements.
please help me to solve it.
god bless you
// while(izig<MaxZig-1)
// int ExtDepth=12; int bigshift=1; int ExtDeviation=5; int ExtBackstep=3; int counted_bars=IndicatorCounted(); int izig=0,MaxZig=8; double Ext,ZigArray[]; ArrayResize(ZigArray,MaxZig); if(counted_bars<0) counted_bars=0; if(counted_bars>0) { counted_bars--; while(izig<MaxZig-1) { Ext=iCustom(symbolName,ZTimeframe,"ZigZag",ExtDepth,ExtDeviation,ExtBackstep,0,bigshift); bigshift++; if(100000*Ext>1) { ZigArray[izig]=Ext; izig++; } } } return (ZigArray);

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 wrote a function to give a vector [ z1...z10] of zigzag index of any forex currency in function output.
but it show error in compliation.
'ZigArray' - invalid array access Ztest.mq4 93 12
that ZigArray is my required vector with 8 elements.
please help me to solve it.
god bless you