# how to create five dimensional array ?

227

```double array[10][9][8][7][6];   // this is giving me an error:
// '[' - wrong dimension

double array[10][9][8][7];      // this is working normally```
28118

You cant go above 4 dimensions unfortunately
227

Lorentzos Roussos:
You cant go above 4 dimensions unfortunately

thank you, but there must be a trick, like putting two multidimensional arrays together

28118

Samih Abdelli:

thank you, but there must be a trick, like putting two multidimensional arrays together

You can merge the [6][7] as [42]

227

Lorentzos Roussos:

You can merge the [6][7] as [42]

yes, thank you, I found a way to solve my prob just with 4 dimensions array

358

Maybe you can build  a 4-dimensional array of vectors. There's no standard class for vectors but in MQL5 there's CArrayDouble.

Initialisation would be as follows:

```#include <Arrays/ArrayDouble.mqh>

CArrayDouble array[10][9][8][7];

void init() {
for(int i=0;i<10;i++)
for(int j=0;j<9;j++)
for(int k=0;k<8;k++)
for(int l=0;l<7;l++) {
array[i][j][k][l].Resize(6);
array[i][j][k][l].Insert(3.14,0);
array[i][j][k][l].Insert(1.07,5);
}
}```
227

lippmaje:

Maybe you can build  a 4-dimensional array of vectors. There's no standard class for vectors but in MQL5 there's CArrayDouble.

Initialisation would be as follows:

thank you but Im using MQL4

468

Samih Abdelli:

thank you but Im using MQL4

Should work in MQL4 as well - ArrayDouble.mqh is also part of standard library available in MQL4.