Download MetaTrader 5

Gettting expert advisor name

To add comments, please log in or register
All MQL5.community events are grouped together. Have a look at the Wall!
KoT 009
44107
KoT 009 2016.05.12 14:38 

is there any way to find whether an ea is running on the chart ( if so , and its name) from the code of an indicator.

Indicator code needs to check for an ea. 

Carl Schreiber
6586
Carl Schreiber 2016.05.12 15:13  
balachandran chandrasekar:

is there any way to find whether an ea is running on the chart ( if so , and its name) from the code of an indicator.

Indicator code needs to check for an ea. 

in mt4(!) I use:

#define FileName StringSubstr(__FILE__,0,StringLen(__FILE__)-4)
Stanislav Korotky
17875
Stanislav Korotky 2016.05.12 15:48  
balachandran chandrasekar:

is there any way to find whether an ea is running on the chart ( if so , and its name) from the code of an indicator.

Indicator code needs to check for an ea. 

If I understood you correctly and you want to run some code in your indicator, which could check if a 3-rd party EA is running on the same chart, then this is not possible.

You probably can try to use ChartSaveTemplate function to save current template to a file and then parse this file for existing EA, but this looks like a hack.

It would be better if you state your actual task. Currently it's not clear what you want to achieve.

Denis Sartakov
603
Denis Sartakov 2016.05.12 18:27  
Stanislav Korotky:

If I understood you correctly and you want to run some code in your indicator, which could check if a 3-rd party EA is running on the same chart, then this is not possible.

You probably can try to use ChartSaveTemplate function to save current template to a file and then parse this file for existing EA, but this looks like a hack.

It would be better if you state your actual task. Currently it's not clear what you want to achieve.

For the sake of to say something  as joke - we can parse also Experts Logs to see if it starts on current chart...

Alain Verleyen
Moderator
30719
Alain Verleyen 2016.05.12 18:53  
Denis Sartakov:

For the sake of to say something  as joke - we can parse also Experts Logs to see if it starts on current chart...

Or take a screenshot and analyse the picture for the smiley presence :-)
Denis Sartakov
603
Denis Sartakov 2016.05.12 19:29  
Alain Verleyen:
Or take a screenshot and analyse the picture for the smiley presence :-)
fine, the best way to test what is your skills level...
KoT 009
44107
KoT 009 2016.05.13 03:25  
Alain Verleyen:
Or take a screenshot and analyse the picture for the smiley presence :-)

my indicators use so many objects on right side of the chart. it actually covers that smiley area.

i solved my purpose quiet easily. i made the expert advisor to create a invisible text object with name "Name of EA". The EA removes this object when deinitialized.

The indicator code checks for the prescence of the object "Name of EA" to find whether the EA is attached or NOT.

Problem Solved ! 

Stanislav Korotky
17875
Stanislav Korotky 2016.05.13 12:52  
Denis Sartakov:

For the sake of to say something  as joke - we can parse also Experts Logs to see if it starts on current chart...

I'm not sure the terminal provides access to the logs from its "sandboxed" scripts, but this is of course can be done via DLLs. Nevertheless, the logs are written into the files on disk with a large lag due to in-memory caching, so you can wait quite a while before actually get required information. ;-)

Anyway the final solution of OP is ok, but it was not clear that he has the code of the EA and can change it.

Alexander Puzanov
29607
Alexander Puzanov 2016.05.13 13:32  
Denis Sartakov:

For the sake of to say something  as joke - we can parse also Experts Logs to see if it starts on current chart...

Not so easy, there may be several charts with the same Symbol / TF - there's no 'Chart ID' in the logs..
KoT 009
44107
KoT 009 2016.05.13 15:59  
Stanislav Korotky:

I'm not sure the terminal provides access to the logs from its "sandboxed" scripts, but this is of course can be done via DLLs. Nevertheless, the logs are written into the files on disk with a large lag due to in-memory caching, so you can wait quite a while before actually get required information. ;-)

Anyway the final solution of OP is ok, but it was not clear that he has the code of the EA and can change it.

i always use my own codes. i never use third party EA's.
To add comments, please log in or register