MQL5 gave a mass of innovations, including work with events of various types (timer events, trade events, custom events, etc.). Ability to handle events allows you to create completely new type of programs for automatic and semi-automatic trading. In this article we will consider trade events and write some code for the OnTrade() function, that will process the Trade event.
seems to indicate that DEAL_ENTRY isn't sufficient for determining what happened, you subsequently have to check DEAL_TYPE.
The article is a few years old but I hope it is still valid since I have been studying it in detail the last few days.
Rik
No, I don't think so.
This code does the same as mine (checks for DEAL_ENTRY), implying that all cases can occur. However, my problem is that only ever DEAL_ENTRY_IN is occurring, while all cases should occur according to buy/sell/reverse operations.
Subsequent checking for DEAL_TYPE will give additional information, however not relevant in my case (for it is only a simple test).
This code does the same as mine (checks for DEAL_ENTRY), implying that all cases can occur. However, my problem is that only ever DEAL_ENTRY_IN is occurring, while all cases should occur according to buy/sell/reverse operations.
Subsequent checking for DEAL_TYPE will give additional information, however not relevant in my case (for it is only a simple test).
how bout this then... since you aren't calling HistorySelect(...), you aren't selecting from the latest history?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
This article
https://www.mql5.com/en/articles/40
seems to indicate that DEAL_ENTRY isn't sufficient for determining what happened, you subsequently have to check DEAL_TYPE.
The article is a few years old but I hope it is still valid since I have been studying it in detail the last few days.
RikThis article
https://www.mql5.com/en/articles/40
seems to indicate that DEAL_ENTRY isn't sufficient for determining what happened, you subsequently have to check DEAL_TYPE.
The article is a few years old but I hope it is still valid since I have been studying it in detail the last few days.
RikNo, I don't think so.
This code does the same as mine (checks for DEAL_ENTRY), implying that all cases can occur. However, my problem is that only ever DEAL_ENTRY_IN is occurring, while all cases should occur according to buy/sell/reverse operations.
Subsequent checking for DEAL_TYPE will give additional information, however not relevant in my case (for it is only a simple test).
No, I don't think so.
This code does the same as mine (checks for DEAL_ENTRY), implying that all cases can occur. However, my problem is that only ever DEAL_ENTRY_IN is occurring, while all cases should occur according to buy/sell/reverse operations.
Subsequent checking for DEAL_TYPE will give additional information, however not relevant in my case (for it is only a simple test).
how bout this then... since you aren't calling HistorySelect(...), you aren't selecting from the latest history?
Yeah, problem solved:
One has to first copy [the deal] into [the deals] cache via i.e. HistoryDealSelect(deal_ticket) !?
Then one can query for i.e. HistoryDealGetInteger(...) ...
Not very intuitive though..