Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 379
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
It doesn't matter how to rebuild it, as long as it works.
There is some difference in some cases. If for (int i = 0; i < OrdersTotal(); i++), the OrdersTotal() function is called on each loop, and if for (int i = OrdersTotal()-1; i>=0; i--), then the OrdersTotal() function is called only once. I haven't experimented with the speed of execution in mql. Once, in php, the count() function worked for 17 seconds in a forward loop and 0.01 seconds in a reverse one.
Measured the speed of forward and reverse cycle. 100 orders, the reverse cycle is 5 times faster. But there are never so many orders, 10 at the most. If there are 10 orders, the speed is 3 times faster. It is quite sensible to choose a reverse cycle.
Can you advise how to normalise the price?(My post above) .
Can you tell me how to normalize the price? (My post above).
There is a NormalizeDouble() function.
When multiplying, it's better to put double first, then int, otherwise in some cases you may lose the fractional part.
Is it possible to set the opening of an order in this way?
No.
This is how it should be done:
if(Line_7 > Lines_1 && Lines_1 > Line_6)
I also checked the profit calculation speed by summing up the profits of all orders and selecting only market orders:
и
The first option is a bit faster, but not significantly. The speed ratio is about 1/1.1There is a NormalizeDouble() function.
When multiplying, it is better to put double first, then int, otherwise you may lose the fractional part in some cases.
Now I get error 3: "Incorrect parameters have been sent to the trading function, e.g., wrong symbol, unidentified trade operation, negative price tolerance, non-existing ticket number, etc. The program logic needs to be changed".
I now get error 3: "Incorrect parameters have been sent to the trade function, e.g. wrong symbol, unidentified trade, negative price tolerance, non-existing ticket number, etc. The program logic needs to be changed".
Translate the cursor to the first opening parenthesis after OrderSend, delete this parenthesis, re-enter, this will open a parameter type prompt, check that all parameters are of the correct type.
No.
That's the way to do it:
Right on! Thank you! ;)