Download MetaTrader 5

How to identify EA names are running currently on the terminal in MQL4

To add comments, please log in or register
Nicolae Zarna
Nicolae Zarna  

Hi guys,

I am looking for a way/function in MQL4 to return the name of each EA running on each chart, if any.

For indicators, coder can navigate among charts and identify the indicators running on each chart.

I wasn't able to find a similar function for experts.

Is there any one?

To better understand my need:

I developed a tool to manually place trades, something similar to the  MT4's "Order" panel itself.

Among other functions, it allows trader to place pending trades during  market closed time.

The EA saves all data needed for a trade in a file and when market opens it place the trade (with a delay or nor, there a lot of custom settings).

Say trader wish to place pending positions during market is closed on EURUSD, GBPUSD and USDJPY. 

He opens 3 charts and loads the EA on each chart. 

Now there are 2 scenarios: 

1. When market opens, EA try to place only the pendings set for his instrument. 

This looks ideal, but problem is that many users change chart instrument, instead of opening a new chart for a new instrument.

If this occurs, will remain a forgotten pending, and eventually trader will not have his trade placed.

2. When market opens, EA reads all pending positions and place all trades, notwithstanding the instrument.

This looks fine, problem is that if user loads the EA on 3 charts, there is a huge chance that all 3 EA read the pendings before files are deleted (pending files are deleted only if no err) and try to place same trade each one.

A solution is to set a priority, such as, the EA loaded on the chart with the smallest ID is allowed to place market closed pending trades.

For practical reasons I prefer the second scenario, but I am not able to set a priority among EAs.

 Thank you!


Nicolae Zarna
Nicolae Zarna  

This is how the tool looks like:

Trading Box 

Mary Clark
Mary Clark  

It might be easier to detect when they changed the symbol and then notify them if they have pending orders. Are you sure you want to do this ?



Ex Ovo Omnia
Ex Ovo Omnia  

I would keep the file open by the EA exclusively, without the sharing option. No additional EA could get its handle, neither for the read nor for the write. If they re-init, only the first one succeeds to get the handle again.

To add comments, please log in or register