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
This reminds me a matrices...
for the orders array, you said 0=buy and 1=sell
so how would I initialise this?
OrdersArray[10,2] = {.......}{...} ?
I think it is exactly like matrices
You initialize it with one set of braces and as many values as you can fit in the array or just one value for the whole array and then add the actual values later.
Yes I said buy and sell is 0 and 1 because when you work with orders, the ordertypes are those integer values.
Most times you will find the easiest way is to initialize the whole array to a single value (just because you have to initialize it) then add the values later.
ordersarray[10,2] = {0};
When you use for loops with arrays it all will make sense.
I think it is exactly like matrices
You initialize it with one set of braces and as many values as you can fit in the array or just one value for the whole array and then add the actual values later.
Yes I said buy and sell is 0 and 1 because when you work with orders, the ordertypes are those integer values.
Most times you will find the easiest way is to initialize the whole array to a single value (just because you have to initialize it) then add the values later.
ordersarray[10,2] = {0};
When you use for loops with arrays it all will make sense.
I've noticed something
Myarray [3][4] is multi-dimensional but look
Myarray [3][4] = {x,y,z}
It is defined using a one-dimensional form, meaning that for one of the dimensions only one value is valid even though the size allows for 4, so that Myarray [2,0]=z but Myarray[2,1] = 0 and Myarray[0,2] also = z.
I think it is exactly like matrices
You initialize it with one set of braces and as many values as you can fit in the array or just one value for the whole array and then add the actual values later.
Yes I said buy and sell is 0 and 1 because when you work with orders, the ordertypes are those integer values.
Most times you will find the easiest way is to initialize the whole array to a single value (just because you have to initialize it) then add the values later.
ordersarray[10,2] = {0};
When you use for loops with arrays it all will make sense.
I've noticed something
Myarray [3][4] is multi-dimensional but look
Myarray [3][4] = {x,y,z}
It is defined using a one-dimensional form, meaning that for one of the dimensions only one value is valid even though the size allows for 4, so that Myarray [2,0]=z but Myarray[2,1] = 0 and Myarray[0,2] also = z.
"In the initialized sequence one or several constants can be omitted. In such a case corresponding array elements of numeric type are initialized by zero, elements of arrays of string type are initialized by string value "" (quotation marks without a space), i.e by an empty line (shouldn't be confused with a space)."
and then shows this example,
it was probably meant to be:
Yes, in the first example Mas_s[2] will be initialised with 0
Result
13:03:01 aaa CADJPY,H1: Array A =ab0d
13:03:01 aaa CADJPY,H1: Array B =abd
13:03:01 aaa CADJPY,H1: Array C =ab d
I've noticed something
Myarray [3][4] is multi-dimensional but look
Myarray [3][4] = {x,y,z}
It is defined using a one-dimensional form, meaning that for one of the dimensions only one value is valid even though the size allows for 4, so that Myarray [2,0]=z but Myarray[2,1] = 0 and Myarray[0,2] also = z.
yes if you fill array that way it fills it sequentially starting with the first dimension
so int myarray[2][2] = {1,2} would fill
myarray[0,0]=1
myarray[1,0]=2
myarray[0,0]=1
myarray[0,1]=2
how would you get it to do this using a loop
Would you use variables i and j with limits in accordance with the array size?
so it should fill it in this sequence
[0,0]
[0,1]
[0,2]
[0,3]
then
[1,0]
[1,1]
[1,2]
[1,3]
then
[2,0]
[2,1]
[2,2]
[2,3]
so int myarray[2][2] = {1,2} would fill
myarray[0,0]=1
myarray[1,0]=2
myarray[0,0]=1
myarray[0,1]=2
how would you get it to do this using a loop
Would you use variables i and j with limits in accordance with the array size?
yes you can substitute the dimensional constants with a variable
for(int i=0; i<2, i++)
{myarray[i,0] = ? // would add values to the 1st
}
you could also do it the other way
for(i=0; i<2; i++)
{myarray[0,i] = ?
}
you could also do it the other way
for(i=0; i<2; i++)
{myarray[0,i] = ?
}
Thanks for clearing that up, it does feel a lot like matrices.