Normally an EA provides its trades with its individual MagicNumber while manual trades have a MagicNumber of 0: https://www.mql5.com/en/docs/constants/structures/mqltraderequest
magic | Expert Advisor ID. It allows organizing analytical processing of trade orders. Each Expert Advisor can set its own unique ID when sending a trade request. |
- www.mql5.com
Yes! Just hover your mouse over the trade and a tooltip will pop up, indicating the type of trade.
Hi
Is there a way to determine which trades were taken with expert and which were entered manually in the history of Metatrader (4 or 5)?
In MQL5 code ...
... evaluate the reason for order placement ( ENUM_ORDER_REASON ) ...
ORDER_REASON_CLIENT
The order was placed from a desktop terminal
ORDER_REASON_MOBILE
The order was placed from a mobile application
ORDER_REASON_WEB
The order was placed from a web platform
ORDER_REASON_EXPERT
The order was placed from an MQL5-program, i.e. by an Expert Advisor or a script
... evaluate the reason for deal execution ( ENUM_DEAL_REASON ) ...
DEAL_REASON_CLIENT
The deal was executed as a result of activation of an order placed from a desktop terminal
DEAL_REASON_MOBILE
The deal was executed as a result of activation of an order placed from a mobile application
DEAL_REASON_WEB
The deal was executed as a result of activation of an order placed from the web platform
DEAL_REASON_EXPERT
The deal was executed as a result of activation of an order placed from an MQL5 program, i.e. an Expert Advisor or a script
In MQL4 code ...
It is only partially possible by looking at the magic number to see if it is non-zero (placed by an EA).
If it is a zero magic number, then it will remain unclear, but in most cases it will be manual.
Returns an identifying (magic) number of the currently selected order
- docs.mql4.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi
Is there a way to determine which trades were taken with expert and which were entered manually in the history of Metatrader (4 or 5)?