Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1687
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
Array size is the number of array elements (or orders for example)
The first element has an index of 0, always,
the last one is one less than the array size.
If you want to create an array with one element, the only way to access that element is to use arr[0]. In all other cases, you will get an array overrun error.
It is the same with orders, just no error, but you cannot reach the first element (order) any other way.
You are not making a pass on a number, but on the list of orders in your trading account! And the number of orders is just a number... you can't make passes on it... how do you make a pass on a number 100? You don't... And on the list of 100 lines, we can make a pass of each line.
The number returned by OrdersTotal() is a prime number... It was designed in such a way that it ALWAYS coincides with the number of orders in the list.
If you know you only have 1 order at all times, then you only need to work with an order number "0" without any OrdersTotal()...
You are not making a pass on a number, but on the list of orders in your trading account! And the number of orders is just a number... you can't make passes on it... how do you make a pass on a number 100? You don't... And on the list of 100 lines, we can make a pass of each line.
The number returned by OrdersTotal() is a prime number... It was designed in such a way that it ALWAYS coincides with the number of orders in the list.
If you know you only have 1 order at all times, then you just work with an order number "0" without any OrdersTotal()...
The array size is the number of array elements (or orders, for example)
The first element has an index 0, always,
the last one is one less than the array size.
If you want to create an array with one element, the only way to access it is to use arr[0]. In all other cases, you will get an array overrun error.
It is the same with orders, just no error, but you cannot reach the first element (order) any other way.
The array (list) goes through a CYCLE. The OrderSelect only selects the order whose order number was created in this cycle for further work.