Errors, bugs, questions - page 1914
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
Could you be more specific?
start from scratch
Could you be more specific?
start from scratch
These are two equivalent options. If for (i=1...) then OrderSelect(i-1,...), if for (i=0,...) - OrderSelect(i,...)
for(i=1; i <=OrdersTotal(); i++) Orders in this list are numbered from zero to OrdersTotal()-1 inclusive (let Artem Trishkin excuse me, just shortened the wait for nys2000).
Thanks, but the numbering of orders from 0 to OrdersTotal()-1 is taken into account in OrderSelect(i-1,...)
Thank you, but the numbering of orders from 0 to OrdersTotal()-1 is accounted for in OrderSelect(i-1,...)
Do the reverse order of the search ...
Here's a simple code like this:
At the moment the function is started, two Buy positions are open. The function prints the presence of two orders twice: Passage 1, Passage 2.
We remove the comments and run the function again. It vigorously takes down one buy order, declares "Passage #1" and leaves the loop. The message "Passage #2" does not appear.
What is the magic?
1. i=1, we calculated the orders ... checked condition 1<= 2 ? yes. Selected and closed the order.
2. i++ (i=2)
3. OrdersTotal()=1 <---------- by closing the order inside the loop actually changed the condition to exit the loop
4. 2<=1 ? no <----------- here your "magic" and accordingly exit from the loop
why is there an additionalCHART_WINDOW_HANDLE chart ID, what purpose does it serve?
why is there an additionalCHART_WINDOW_HANDLE chart ID, what purpose does it serve?
Error during execution
Result: random number (certainly not 3)