MQL5 suggestion - parametric OnTrade() event handler

 

Hello MetaQuotes,

Just came up with a suggestion - could you consider ehancing the OnTrade() event handler? The solution that I propose is  having OnTrade(ENUM_TRADE_EVENT_TYPE &event_type), which would allow MQL5 programmers to handle particular trade events (e.g. stop loss/take profit modification, pending order execution, new deal etc.) in an elegant and optimally efficient way. Currently every time a trade event happens, we can just "guess" what it could be and try do determine it e.g. by the number of orders/positions/deals, which isn't very flexible and has some other drawbacks as well. I guess that as you can detect a trade event and trigger handling it in OnTrade(), it shouldn't be a big deal to make such an improvement?

Please give your comments on this idea. 

Documentation on MQL5: Trade Functions / OrdersTotal
  • www.mql5.com
Trade Functions / OrdersTotal - Documentation on MQL5
 
The function OnTrade() will be improved, certainly. This question is open still.
 

Thanks for a quick reply, Rosh. This is a great news.  And what about my above proposition with enumerative type of trade_event, passed as a reference - is there a chance for such solution? Or maybe even OnTrade(ENUM_TRADE_EVENT_TYPE &event_type, string &symbol) would be better.


By the way - are there any (even rough) estimates whether this will be improved before ATC2012? 

 
Enigma71fx:

Thanks for a quick reply, Rosh. This is a great news.  And what about my above proposition with enumerative type of trade_event, passed as a reference - is there a chance for such solution? Or maybe even OnTrade(ENUM_TRADE_EVENT_TYPE &event_type, string &symbol) would be better.


By the way - are there any (even rough) estimates whether this will be improved before ATC2012? 

Hello,

Rosh - are there any news on this topic?

 

I put my vote for this enhancement! It would be very appreciated 

 
lamemind:

I put my vote for this enhancement! It would be very appreciated 

I guess that you have already found it, but just to be sure  --> https://www.mql5.com/en/docs/basis/function/events --> OnTradeTransaction.
Documentation on MQL5: Language Basics / Functions / Event Handling Functions
  • www.mql5.com
Language Basics / Functions / Event Handling Functions - Documentation on MQL5
 
Documentation on MQL5: Language Basics / Functions / Event Handling Functions
  • www.mql5.com
Language Basics / Functions / Event Handling Functions - Documentation on MQL5
Reason: