I don't get it, All this information is already available in predefined arrays.
there no structures in mql4
so, the easiest just to create as many arryas as necessary and refer to them with single index to retrieve values.
datetime DATE[10];
double CALCRES[10];
thisdate=DATE[3];
thisres=CALCRES[3];
something like that.
so, the easiest just to create as many arryas as necessary and refer to them with single index to retrieve values.
datetime DATE[10];
double CALCRES[10];
thisdate=DATE[3];
thisres=CALCRES[3];
something like that.
and why not... you know they say that bad dancer has got his legs in the way. Anyway
it's a russian saying.
irusoh1 wrote:
and why not... you know they say that bad dancer has got his legs in the way. Anyway it's a russian saying.
and why not... you know they say that bad dancer has got his legs in the way. Anyway it's a russian saying.
WHY cant I get a straight amswer....
I just want a example of using a two dimension array, with two data types like double and string.
TO see looping, and assigning values into array...
Jes wayne ...
array double[][2];
ArrayResize(array, 10); //10 or whatever (like number of bars).
ArrayInitialize(array, 0);
for(int i = 0; i < 10; i++)
{
array[i][0] = /*date time */;
array[i][1] = /*double calc */;
}
ArrayResize(array, 10); //10 or whatever (like number of bars).
ArrayInitialize(array, 0);
for(int i = 0; i < 10; i++)
{
array[i][0] = /*date time */;
array[i][1] = /*double calc */;
}
Craig:
array double[][2];
ArrayResize(array, 10); //10 or whatever (like number of bars).
ArrayInitialize(array, 0);
for(int i = 0; i < 10; i++)
{
array[i][0] = /*date time */;
array[i][1] = /*double calc */;
}
array double[][2];
ArrayResize(array, 10); //10 or whatever (like number of bars).
ArrayInitialize(array, 0);
for(int i = 0; i < 10; i++)
{
array[i][0] = /*date time */;
array[i][1] = /*double calc */;
}
Thanks...
icm63:
Thanks...
Craig:
array double[][2];
ArrayResize(array, 10); //10 or whatever (like number of bars).
ArrayInitialize(array, 0);
for(int i = 0; i < 10; i++)
{
array[i][0] = /*date time */;
array[i][1] = /*double calc */;
}
array double[][2];
ArrayResize(array, 10); //10 or whatever (like number of bars).
ArrayInitialize(array, 0);
for(int i = 0; i < 10; i++)
{
array[i][0] = /*date time */;
array[i][1] = /*double calc */;
}
Thanks...
"ArraySort" function shorts array of one dimenson, ....so how do I sort the above array on the array[i][1] data..DESCENDING
array double[][2];
should be
double array [][2];
etc
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
CalculationResult = Result of some function or forumla for each bar in chart.
double Data[];
Start loop i
Data[i] = CalculationResult
end loop i
But if I wish to store two pieces of information in the array, like Date and 'CalculationResult' for the bars on chart. How is that done.
- I dont know what size the array would be as chart bars number can change.
- Can MT4 Multi arrays store two or more data types like Date and Double ( Are the structures for this variable ??)
- I need to add data and be able to get data out..
So how does a loop look on a multi dymension array anyways !
I found this from zolero : 'Getting prices from another symbol?'
double array[x][6];
x- length of data or number of Bars
the second dimension is information about Time, Open, Close, High, Low, Volume
Q: So how does the loop look like, as an example ?