Download MetaTrader 5

Gettting expert advisor name

To add comments, please log in or register
Balachandran Chandrasekar
44121
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. 

Carl Schreiber
6790
Carl Schreiber  
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
18858
Stanislav Korotky  
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
656
Denis Sartakov  
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
31599
Alain Verleyen  
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
656
Denis Sartakov  
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...
Balachandran Chandrasekar
44121
Balachandran Chandrasekar  
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
18858
Stanislav Korotky  
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
30549
Alexander Puzanov  
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..
Balachandran Chandrasekar
44121
Balachandran Chandrasekar  
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