Hello People, I am desperately trying to get an Array to work for the first time in MT4 (I have always struggled with this, and I am not a coder), but I have to be honest most of the documentation I have found so far it of little use to me, maybe because I am some sort of idiot. Can somebody please look at the attached code and tell me why on earth my Array using the Print command is just returning 0's, I am trying to keep it as simple as possible. My main goal is to load an array with the delta values and then find a moving average of those values. Also if anybody has a link to 'MQL4 Arrays for Dummies' I would very grateful, I am determined to learn this. Cheers.
Inserted Code
int start() { int countedBars = IndicatorCounted(); int limit, i; if(countedBars<0) return(-1); if(countedBars>0) countedBars--; limit = Bars-countedBars; double HiLoDelta[]; double OpClDelta[]; ArrayInitialize (HiLoDelta,0); ArrayInitialize (OpClDelta,0); // // for(i=limit; i>=0; i--) { //double VolumeDelta = Volume[i]; if (Open[i]>Close[i]){OpClDelta[i]=Open[i]-Close[i];} if (Close[i]>Open[i]){OpClDelta[i]=Close[i]-Open[i];} HiLoDelta[i]= High[i]-Low[i]; double OpClDeltaAv = iMAOnArray(OpClDelta,0,4,0,MODE_SMA,i); double HiLoDeltaAv = iMAOnArray(HiLoDelta,0,4,0,MODE_SMA,i); Print(HiLoDelta[1]+" "+HiLoDelta[2]+" "+HiLoDelta[3]);