for array of array, you only can :
double array1[][4]; // should fix 2nd dimension size
ArrayResize(array1, 20); //set 1st dimension size
Since ArrayResize(...) of MQL only can be used for setting 1st dimension size !
Hmmm. thanks for that. I'll have to rethink my storage strategy. maybe not have StatsTally resize array if needed.
Should anyone be interested, I fixed it by coding:
int Stats.Tally(double pTallyValue, double& pStatHolder[], int pStartIx); ... double AllHrStats[]; // 169th = weekly gap ... StatsSz = Stats.Size(); // = 3 ArrayResize(AllHrStats, 169*StatsSz); ... for(int iHr=0; iHr<168; iHr++) { ... double tr = MathMax(H, PC) - MathMin(L, PC); Stats.Tally(tr, AllHrStats, iHr*StatsSz); } ... for(iHr=0; iHr<168; iHr++) { int N = Stats.N(AllHrStats, iHr*StatsSz); if(N == 0) continue; double Avg = Stats.Avg(AllHrStats, iHr*StatsSz); double SD = Stats.StdDev(AllHrStats, iHr*StatsSz); Print("iHr=", iHr, ", N=", N, ", Avg=", DoubleToStr(Avg, 5), " SD=", DoubleToStr(SD, 5)); }
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'm trying to create & use an array of arrays, and got stuck.
If anyone can point me in the right direction on how to use a (dynamic or fixed) array of (single dimensional dynamic array), I would appreciate it.
(I've searched for 'array of arrays' here & not found anything suitable)