Returned value
·-1, if array1[] less than array2[]
·0, if array1[] equal to array2[]
·1, if array1[] more than array2[]
·-2, if an error occurs due to incompatibility of the types of compared arrays or if start1, start2 or count values lead to falling outside the array.
qjol:
As u can see from my code i loade the array_buyTicket with a value of 397, array_toCompare has still the value 0. So the array content is not equal. Does ArrayCompare only compare the size and not the content?
Returned value
·-1, if array1[] less than array2[]
·0, if array1[] equal to array2[]
·1, if array1[] more than array2[]
·-2, if an error occurs due to incompatibility of the types of compared arrays or if start1, start2 or count values lead to falling outside the array.
Lines_ss:
Does ArrayCompare only compare the size and not the content?
that's right
Lines_ss:
Sorry, next time I will remember. It's my first time I used the forum.
Don't worry, this is why I explain that to you.
Sorry, next time I will remember. It's my first time I used the forum.
qjol:
that's right
@qjol: U are my hero ;-) Mql documentation was quite miss understanding for me.But now I understand the problems in my EA.
that's right
If you want to compare arrays what they contain, use a for loop

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
Hello,
am not sure whether I understood the function ArrayCompare right or not. From my understanding I thought I could compare the content of 2 Array.
I tried the following code:
The result which I get during execution is:11:08:57 2010.01.18 11:00 Forex_ORB-v1.10.1 GBPJPY,M5: array_buyTicket_0 = 0
11:08:57 2010.01.18 11:00 Forex_ORB-v1.10.1 GBPJPY,M5: array_sellTicket_0 = 0
11:08:57 2010.01.18 11:00 Forex_ORB-v1.10.1 GBPJPY,M5: array_buyTicket_0 = 397
11:08:57 2010.01.18 11:00 Forex_ORB-v1.10.1 GBPJPY,M5: Array_BuyTicketIsEmpty: 0
11:08:57 2010.01.18 11:00 Forex_ORB-v1.10.1 GBPJPY,M5: Array_SellTicketIsEmpty: 0
So my question now: Why do I get the value Array_BuyTicketIsEmpty: 0 even the arrays are not equal. Does the function ArrayCompare only compare the size of the array but not the content of the array?
Thanks in advance!