External Trigger for EA

 

Hi there!

Question please ...

If I have 3 instances of MT5 installed on a PC and I need to trigger something on 3 @ same time what is the best option?

I am considering having a MySQL database and on every OnTick(), each EA running on each instance runs a query and check for some parameter. This way, I will have all Instances/ EA changing its behavior simultaneously.

Is MySQL a good option? A regular text file?

Regards

MRC

 
YouTrade:

Hi there!

Question please ...

If I have 3 instances of MT5 installed on a PC and I need to trigger something on 3 @ same time what is the best option?

I am considering having a MySQL database and on every OnTick(), each EA running on each instance runs a query and check for some parameter. This way, I will have all Instances/ EA changing its behavior simultaneously.

Is MySQL a good option? A regular text file?

Regards

MRC

Did you take a look at the File Funtions of MQL5? You can read a single file from 3 different MT5 instances at the same time.
 
Malacarne:
Did you take a look at the File Funtions of MQL5? You can read a single file from 3 different MT5 instances at the same time.
I will. I was just wondering from where to start it. If a regular text file is the best approach, we will take it. Thank you !
 
YouTrade:
I will. I was just wondering from where to start it. If a regular text file is the best approach, we will take it. Thank you !

Hi Marcelo, technically we call this 'mutual dependency', and it depends on what you need to trigger ('the something'), and maybe you don't need any external exchange to do this. 

If you can share who and how 'the something' is, the answer can be more precise, since to use just an internal EA algorithm, if possible, probably is the best option for you. 

Anyway, if not possible share this, and your option is use files to do that, the main point is don't forget flag FILE_COMMON, since your file will be used for all MT5 client terminals. This flag is used in FileOpen(), FileCopy(), FileMove(), and in FileIsExist() functions.

Use of a database to do this looks like 'kill a fly with a cannon shoot', as we are used to say on Brazil, since your intention is just synchronize the EAs. In the last case, if it's really necessary, I would use just HTTP to do this.

 
figurelli:

Hi Marcelo, technically we call this 'mutual dependency', and it depends on what you need to trigger ('the something'), and maybe you don't need any external exchange to do this. 

If you can share who and how 'the something' is, the answer can be more precise, since to use just an internal EA algorithm, if possible, probably is the best option for you. 

Anyway, if not possible share this, and your option is use files to do that, the main point is don't forget flag FILE_COMMON, since your file will be used for all MT5 client terminals. This flag is used in FileOpen(), FileCopy(), FileMove(), and in FileIsExist() functions.

Use of a database to do this looks like 'kill a fly with a cannon shoot', as we are used to say on Brazil, since your intention is just synchronize the EAs. In the last case, if it's really necessary, I would use just HTTP to do this.

Hi there ... I am working on the MA inversion and I am planning to use an external trigger to inform all EA that the MA are inverted. ;)
 
YouTrade:
Hi there ... I am working on the MA inversion and I am planning to use an external trigger to inform all EA that the MA are inverted. ;)
From the programming point of view, this is an interesting exercise. However, from the trading point of view, could you explain what would be logic / advantages of the inversion of moving averages? I really don't get the point...
 
YouTrade:
Hi there ... I am working on the MA inversion and I am planning to use an external trigger to inform all EA that the MA are inverted. ;)
Why can't you run this code in the 3 platforms ? I can't see any advantages to run a code in a platform and then have to inform other platform of the results.
 
Malacarne:
From the programming point of view, this is an interesting exercise. However, from the trading point of view, could you explain what would be logic / advantages of the inversion of moving averages? I really don't get the point...
my ea is based on two ma. depending on the periods and type, the ma get inverted so when the fast cross slow up the system sells because the position of the ma's are inverted.
 
YouTrade:
my ea is based on two ma. depending on the periods and type, the ma get inverted so when the fast cross slow up the system sells because the position of the ma's are inverted.
I still don't understand. It would be much easier if you could invert the sign (">" instead of "<") inside your code... You don't have to "invert" any moving average to do that...
Reason: