Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 606

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
Thanks for the advice. I'm not a very experienced programmer. and I use a style that's comfortable for me, I haven't learned how to bring it to a common style on this site yet. - I have not yet learned how to do it.
But you can paste the code into your post (Alt+S), albeit with your style. However, you can always use the styler in the editor (Ctrl+,) to bring the style to the adopted on the site. Although it's not convenient for everyone, it's better than something unreadable.
But you can insert the code into your post (Alt+S), albeit with your style. However, you can always use the styling tool in the editor (Ctrl+,) to bring the style to that of the site. Although it's not convenient for everyone, it's better than something unreadable.
Well, I got something. Only in essence I didn't understand where my mistake is
What do you want to achieve anyway?
From what you have shown it is impossible to understand - there is no data about the values of the variables used.
What do you want to achieve anyway?
From what you have shown it is impossible to understand - there is no data on the values of the variables used.
The second if statement is optional, but it doesn't work without it
Forum on trading, automated trading systems & strategy testing
Any questions for newbies on MQL4, help and discussion on algorithms and codes
Artyom Trishkin, 2018.08.21 22:14
What do you want to achieve anyway?
From what you have shown it is impossible to understand - there is no data on the values of the variables used.
I have already shown one of the results of this unit
RESULT: Otkritih orders NEXT net
Otkritih ordersov 5
I have already shown one of the results of this unit
RESULT: Otkritih orders NEXT net
Otkritih ordersov 5
I see - stream of consciousness. I removed myself from the discussion...
Read on.
Anton1953 If you are referring to the work of the block that was the very first without if, there is an error. I'll give you a hint - try to run that piece of code with orders with other majiks, there are a lot of orders, but they do not pass the majik condition. Do you need further advice or will you figure it out on your own?
By the way, correct coding helps a lot when searching for such errors because you mark them in your usual style and the error just becomes obvious!
Anton1953 If you are referring to the work of the block that was the very first without if, there is an error. I'll give you a hint - try to run that piece of code with orders with other majiks, there are a lot of orders, but they do not pass the majik condition. Do you need further advice or will you figure it out on your own?
By the way, correct coding helps a lot when searching for such errors because the error is so obvious when you mark them in your usual style!
There are several Expert Advisors running, with different majors. cnt_OO - this is the number of open orders with a certain mode. The block is designed like this: if there is more than one order cnt_OO>1, we select from all open ordersOrdersTotal() the one with the necessary modeif((OrderMagicNumber() == Magic)) and do the necessary actions.
Otherwise we perform other actions. But "otherwise" doesn't work, we have to enterif((cnt_OO == 1)) without it, it doesn't work
Several EAs are running, with different majors. cnt_OO - defined earlier - this is the number of open orders with a particular mode. The block is designed like this: if there is more than one order cnt_OO>1, we select from all open ordersOrdersTotal() the one with the necessary modeif((OrderMagicNumber() == Magic)) and do the necessary actions.
Otherwise we perform other actions. But "otherwise" is not performed, we have to enterif((cnt_OO == 1)) without it it does not work
The fact that you have defined somewhere the number of necessary orders is good, but in this block, you again run through all the orders and check them!
Break the code down properly and you will see at once!