Download MetaTrader 5
To add comments, please log in or register
Find out the latest MQL5.community news!
tfoller
19
tfoller 2016.06.23 13:50 

How do I pass a sub-array of a two dimensional array into CopyRates? The code below doesn't work

MqlRates c[3][200];

CopyRates("AUDUSD", 0, 0, 200, c[0]);

Carl Schreiber
5962
Carl Schreiber 2016.06.23 13:56  

What about reading in the editor's reference (hint F1 if the mouse is of the mt4-function) about MqlRates and CopyRates.

What are their dimensions?

tfoller
19
tfoller 2016.06.23 15:20  
gooly:

What about reading in the editor's reference (hint F1 if the mouse is of the mt4-function) about MqlRates and CopyRates.

What are their dimensions?

You can pass either dynamic array or static if you know the size. I know the size. So if I pass one dimensional array like MqlRates c[200]; CopyRates("AUDUSD", 0, 0, 200, c); that will work. What I need is to pass a sub array from two dimensional array. In C passing the first row of a two dimensional array into a function would be c[0], in mql it doesn't seem to work this way?
Carl Schreiber
5962
Carl Schreiber 2016.06.23 18:11  
You can't pass a part of an array. Either totally: double &arr[][][] or a single value: double &arr[1][3][6] (I think - haven't checked it!!)
/
To add comments, please log in or register