Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 704
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
There's something really wrong, though...
I mean, I do OrderSelect once and then again from the function... That's a hell of a thing...
Simple logic...
Watch the sequence of operations you are making.
Obviously, you must first check the quantity, then select the required order, and then perform the necessary operations on it.
in which direction do you view the order array?
if there are possible closures/deletions during "revision", it is better to look in the opposite direction. From OrdersTotal()-1 to 0 inclusive.
Otherwise you might get in trouble :-)
I almost discovered my personal grail in this way once :-)
And the removal of old orders from the "depths of time" to the present (once in a while, not all of them) raised the tester profitability to the heavens :-)
Simple logic...
Watch the sequence of operations you are making.
It is obvious that you must first check the quantity, then select the right order, and then perform the necessary operations on it
I have done it this way:
Just put order counting first, and then everything else.
Thank you Artem. I owe the grail to it. That was the mistake that was killing me...
How do I calculate the number of decimal places?
for example, i found out that the minimum lot is 0.01.
how do i deduce that the number of decimal places is 2?
to normalise the order volume to two decimal places.
How do I calculate the number of decimal places?
for example, i found out that the minimum lot is 0.01.
how do i deduce that the number of decimal places is 2?
to normalise the order volume to two decimal places later.
Try this one.
Try this one.
Why offer such old stuff?
How to calculate the number of decimal places?
For example, I have learned that the minimum lot is 0.01.
How can I find out that the number of decimal places is 2?
Then normalize the order volume to two decimal places.
Here's a ready-made function in the article.
All that remains is to add an action depending on the result returned by this function.
I put a lot like this
and the trade opens with a volume of 1.11.
So maybe you don't need to normalize anything?
I see that the terminal normalises the order to the required number of decimal places when I open it.
Maybe there is no need to normalize anything?
If the editor does the same - no need.
I see that the terminal normalises the order to the required number of decimal places when it opens.
Maybe you don't need to normalize anything?
If you want to get error after error, do not normalise.
If you want to subsequently get error after error, don't normalise.