Gettting expert advisor name

 

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. 

 
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)
 
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.

 
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...

 
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 :-)
 
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...
 
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 ! 

 
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.

 
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..
 
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.
Reason: