Share info between Experts

fdesu
65
fdesu  

Hello to Everyone,

Is possible to share info between experts?, for example an array?


Thanks in advanced!

Regards!

Fernando Carreiro
5760
Fernando Carreiro  
fdesuIs possible to share info between experts?, for example an array?

The most common and easiest way to share data between EAs (or Indicators, Scripts, etc.) is via Global Terminal Variables, but they only store floating point (double) data. This works for both MT4 and MT5.

Another common way to allows for any data type or quantity to be shared as by sharing files, be they text or binary files, allow for data of any type or length to be shared. This works for both MT4 and MT5.

In MT5 (only) you have a few more options pre-built into MQL5, like the use of Databases (such as SQLite) or Sockets (which can also be used for EAs running on different machines on the network).

There are probably a few other options, like using DLL calls, and maybe even other methods that I have not even thought about.

So, in essence, there are many options available.

fdesu
65
fdesu  
Fernando Carreiro:

The most common and easiest way to share data between EAs (or Indicators, Scripts, etc.) is via Global Terminal Variables, but they only store floating point (double) data. This works for both MT4 and MT5.

Another common way to allows for any data type or quantity to be shared as by sharing files, be they text or binary files, allow for data of any type or length to be shared. This works for both MT4 and MT5.

In MT5 (only) you have a few more options pre-built into MQL5, like the use of Databases (such as SQLite) or Sockets (which can also be used for EAs running on different machines on the network).

There are probably a few other options, like using DLL calls, and maybe even other methods that I have not even thought about.

So, in essence, there are many options available.

Hello Fernando,

I will like to try SQlite!

Thank you!!

Alain Verleyen
41786
Alain Verleyen  
fdesu :

Hello Fernando,

I will like to try SQlite!

Thank you!!

SQLite is not intended to share information between EAs.


Forum on trading, automated trading systems and testing trading strategies

SQLite in MQL5: New Features and Performance Testing

Renat Fatkhullin , 2019.12.07 11:35

Enough blatant nonsense about "killing SSD" from narrow-minded users to distribute.

No, these are file databases - they can be exchanged, but it is risky to simultaneously access from different experts because of the potentially exclusive access with simultaneously open databases.

Databases opened "only in memory by the DATABASE_OPEN_MEMORY flag" are available only to a specific program and are not shared with anyone.


Scopes of databases:

  1. Storing settings and states of MQL5 programs

  2. Storing massive data

  3. Using side-prepared data

    For example, they exported data from Metatrader to SQLite, in Python they calculated this data using ready-made mathematical packages and put the result in SQlite format too.

In the next release, there will be native support for viewing and editing SQLite databases right in the editor, which will lead to the use of these databases as a standard data exchange mechanism.

fdesu
65
fdesu  
Which one is the best method to do this?