Features of the mql5 language, subtleties and tricks - page 184
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's supposed to work. But I wouldn't advise doing it that way.)
This is actually optimal. And it allows you to set more complex sorting conditions.
For example:
Yes and there are no other solutions anyway.
The point of the pattern is to be universal. If you pass another structure in your example that does not contain at least one field a,b,c, it will not compile. That is, the function cannot work with two different data types at the same time.
Forum on trading, automated trading systems and trading strategy testing
Control panel for trading. MQL5 HELP NEEDED
Vladimir Karputov, 2020.08.18 09:04
This code would not work - you can't compare patties and squares:
This condition will work if the pending order is partially executed and generates a position. Then an order and a position with the same ticket will exist at the same time.
For this reason the following construction makes sense in some situations.
Forum on trading, automated trading systems and strategy testing
Libraries: MT4Orders
fxsaber, 2020.08.20 15:44
For those working with asynchronous transactions, it will be useful to know the settings for the maximum possible number of unprocessed asynchronous transactions in your account.
This is not difficult to find out.
Be careful, you can run into a limit.
Renat said a long time ago that not only can you get caught up in a limit, you can also get blocked by a DC
This condition will be triggered if the pending order is partially executed and generates a position. Then an order and a position with the same ticker will exist at the same time.
The following code in aRannForex-Server demo account can immediately reproduce this situation by running this EA.
Result.
By the way, the script shows (not always the first time) a bug in the execution of synchronous OrderSend.
After OrderSend is executed for a few tens/hundreds of milliseconds, the order price is the old one, and not the one that was successfully placed by OrderSend.
Coming back to the topic of identical tickets, we can draw some conclusions.
If someone has managed to reproduce it on another trading server, please share the name.
Search string: Oshibka 010.
Not a unique ticket? How can this be?
Are both orders and trades have unique tickets?
Not a unique ticket? How can that be?
The explanation that can be found is that as long as there is an opening order, there is always a position. It is just not always visible - there is zero volume. And this position has a unique ticket. Well, on a hedge for this reason it is quite possible that there will be in-triggers on the same position after the corresponding in and out trades.
Are the orders and deals even have unique tickets?
They are unique. But of course ORDER_TICKET can be equal to DEAL_TICKET.