m_order.Select(trans.order) works, but m_deal.Ticket(trans.deal) does not (without first HistorySelect() - HistoryDealSelect())
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
Greets,
Hope someone can shed some light on this question. I must either be missing something, or it just is what it is.
I am using OnTradeTransaction() to deal with events. All good, but I'm trying to use the classes (such as CDealInfo, etc) to be as MQL5 idiomatic as possible.
The following works as expected:
However, I would like to know if there is a way to use m_deal.Ticket(trans.deal) for cleaner code (as with the Order sample further below) - which the documentation says is for "Select the position for further work" - but the following replacement code does NOT work:
When working with Orders, this is nice and clean and works:
And I would like to do something similar for selecting/working with deals. I may be wrong, but it doesn't seem possible.
/Edit to add: there is no m_deal.Select(), only m_deal.SelectByIndex(), even though m_deal.Ticket(ticket) *seems* to be the same as m_order.Select(order) - at least that's what the docs imply.
/Edit 2: added the commented out previous Order code which also works