How to tell which EA triggered order?

 

Hi

I'm sorry if this is a stupid question, but if I have multiple timeframes open for the same currency pair, with different EAs running on each of them, how can I tell which EA actually triggered the Buy/Sell order?


Edit: Sorry, just realised if I hover over the order in MT4 I can see the expert ID (magic number).

 
ch1n3s3b0y:

Hi

I'm sorry if this is a stupid question, but if I have multiple timeframes open for the same currency pair, with different EAs running on each of them, how can I tell which EA actually triggered the Buy/Sell order?


Edit: Sorry, just realised if I hover over the order in MT4 I can see the expert ID (magic number).

Add comments while opening orders in EA using OrderComment() API. 

 
  1. Not a good idea to use comments, brokers can change comments, including complete replacement.

  2. Magic Numbers are used to differentiate different EAs.
    Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
              Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum
Reason: