Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1918
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
You need 2 cycles: you find out the minimum volume in the first one and close it in the second one. And note that when you close the orders are shifted by 1 position, so you have to do the cycle from the maximum position to 0.
no. From the earliest to the latest.
I knew what they said. Well, I'll just have to learn by trial and error as usual.
I knew what they said. Well, I'll just have to learn by trial and error as usual.
Good evening, dear experts!
Please help me understand one thing. I am writing the beginning of a function and have decided to check some part of its code with a script:
But the result is printed in the Experts tab is a bit puzzling. The pending order ORDER_TYPE_BUY_STOP has the symbol, but the ORDER_TYPE_SELL_STOP does not have it for some reason.
What can it be connected with? Regards, Vladimir.
Good evening, dear experts!
Please help me understand one thing. I am writing the beginning of a function and have decided to check some part of its code with a script:
However, the result is printed in the Experts tab is a bit puzzling. The pending order ORDER_TYPE_BUY_STOP has the symbol, but the ORDER_TYPE_SELL_STOP does not have it for some reason.
What can it be connected with? Regards, Vladimir.
It has to do with the fact that you have not selected a ticket, but are trying to get its characteristics.
Thank you, Sergey, for your response! Your reply left me even more puzzled. How could it be? When I run the script, all set pending orders are interrogated. As we can see in the image, there are two of them on the chart, and at the same time, one ticket is selected and the other one is not? It is not quite clear.
Can you explain it in more details?
I'm asking this question not out of idle curiosity, but in order to continue the self-study.
Regards, Vladimir.
Thank you, Sergey, for your response! Your reply left me even more puzzled. How could it be? When I run the script, all set pending orders are interrogated. As we can see in the image, there are two of them on the chart, and at the same time, one ticket is selected and the other one is not? It is not quite clear.
Can you explain it in more details?
I'm asking this question not out of idle curiosity, but in order to continue the self-study.
Regards, Vladimir.
So, you have a loop where you change the iterator i from the maximum index to 0. What is going on inside it? Well, here's what happens: the first command you try to get the ORDER_SYMBOL parameter. But, which order are you trying to get it from, because the order will be selected three lines below!
Thank you, Sergey, for the very detailed and understandable explanation! I put the line with the pending order ticket right after the cycle start and everything has worked out fine.
Yes ... Pay attention and pay attention once again. That's what I'm really lacking. Thanks again!
Sincerely, Vladimir.
Good morning, esteemed experts!
Today I have faced two more issues I do not understand, but in a code entirely taken from the MQL5 Reference. This time I didn't write anything myself, but just took a ready-made example.
I open MQL5 Reference / Constants, Enumerations and Structures / Data Structures / Structure of a Trade Request. I find it there:
Structure of the trade requestThis is clear. I am followed by an example with this code:
I'm trying to understand the line highlighted in yellow. Right away I have a question: what does PositionGetDouble(POSITION_PRICE_OPEN) have to do with itif this example is related to pending orders? Maybe, there should be a line like this:
I only find this in the Experts tab: Dear Experts, please help me to understand this example, why it is in the directory, but its code does not work?
Regards, Vladimir.
Dear experts please help me to understand this example, why is it in the reference book, but its code does not work?
Sincerely, Vladimir.
I wrote about it a few pages ago.
This is the forum for trading, automated trading systems and strategy testing.
Any questions from newbies on MQL4 and MQL5, help and discussion of algorithms and codes
Alexey Viktorov, 2022.02.20 10:24
Sasha, you can't think of anything worse than using examples from documentation or tumblr examples. And you've also lost the flag of forced termination of while loop somewhere. All in all ... no words.