cant find a error in this..gives output 0;
Try . . .
int a[3][3];
Tboth are same things written in documentation..tried that also
ankit29030:
Tboth are same things written in documentation..tried that also
OK, I see the problem . . . a[3,2] is not a valid cell in the array, the 3 cells are at 0, 1 and 2.
So . . .
int a[3][3]; a[2,1]=54; Print(a[2,1]);
i have made a 3-d array such that it contains the market order and pending order count of a specific symbol.....
for each symbol it calculates the market order and pending order...now how should i place values in this here is my code...
int start() { for(i=OrdersTotal()-1;i>=0;j--) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); string osym=OrderSymbol(); for(j=OrdersTotal()-1;j>=0;j++) { OrderSelect(j,SELECT_BY_POS); if(osym==OrderSymbol()&& (OrderType()==0 ||OrderType()==1)) mo++; if(osym==OrderSymbol() && (OrderType()==2 ||OrderType()==3||OrderType()==4||OrderType()==5)) po++; } //////////confusion here ordertot[0][0][0]=0; ordertot[0][00][00]=mo; ordertot[0][10][11]=po; }
i have made a 3-d array such that it contains the market order and pending order count of a specific symbol.....
for each symbol it calculates the market order and pending order...now how should i place values in this here is my code...
int start() { for(i=OrdersTotal()-1;i>=0;i--) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); string osym=OrderSymbol(); //Print(osym); for(j=OrdersTotal()-1;j>=0;j--) { OrderSelect(j,SELECT_BY_POS); if((osym==OrderSymbol())&& (OrderType()==0 ||OrderType()==1)) //Print("dd"); mo++; if((osym==OrderSymbol()) && (OrderType()==2 ||OrderType()==3||OrderType()==4||OrderType()==5)) po++; } ordertot[i][0][0]=mo; ordertot[i][0][1]=po; } for(a=OrdersTotal()-1;a>=0;a--) { OrderSelect(a,SELECT_BY_POS); Print(OrderSymbol()," ",ordertot[a][0][0]," ",ordertot[a,0,1]); } return;
like
market order pending order
eurusd 2 1
usdjpy 4 0
gbpjpy 4 2
eurjpy 4 0
So you don't need a 3D array, you could simply use 3 x 1D arrays.
2 x 1D arrays no ? or 1 x 2D array.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use