accessing name of expert adviser

 

hi,

i am working on a number of expert advisers and running them all in parallel on a demo account. at some times i have quite a few orders executed in parallel and it is rather difficult, without referring back to the logs all the time, to ascertain which EA initiated each of the orders. ideally i would like to insert something into the comment field of each EA which would identify the EA as well as the period of the associated chart. i would like to generate this identification string in an automated way. so, for example, if the EA is coded in the file runmean.mq4 and i am running it on a 15M chart then i would like to have a comment string like:

"runmean 15"

now i can easily get the time frame using Period(). what about the EA name? short of inserting the EA name directly into the code, is there not a programmatical way of accessing the EA file name?

thanks!

best regards,

andrew.

 

C

Use the function WindowsExpertName() that you can use as all or part of the OrderComment when you use OrderSend

Good Luck

-BB-

 

Presumably, each EA has it's own deciferable magic number... you can acces that easily enough and insert it in the comment with the order.

V

 
BarrowBoy:

C

Use the function WindowsExpertName() that you can use as all or part of the OrderComment when you use OrderSend

Good Luck

-BB-

Cool, a new function (new to me anyway)... Never seen that one before.
 
BarrowBoy:

C

Use the function WindowsExpertName() that you can use as all or part of the OrderComment when you use OrderSend

Good Luck

-BB-



great. that worked perfectly. thanks a lot!
 
WHRoeder:
New to everyone. Does not exist.
https://docs.mql4.com/windows/WindowExpertName
Reason: