Libraries: Interchange

 

Interchange:

Class for exchanging data between programs. It allows to pass structures of arbitrary size via the global variables of the terminal from one program to another.

Author: Andrey Miguzov

[Deleted]  

2.5. Не забываем уничтожать экземпляр класса при деинициализации программы:

Ind_buffer.Destroy();

Why didn't you put a call to Destroy() in an empty destructor?

 
Anton Zverev:

Why didn't they put Destroy() call in the empty destructor?

I was looking at it now, remembering :) It's not critical - you can put it in the destructor for universality.

SZY: I saw somewhere on the forum that you can also use image resources for exchange. Probably, it will be even faster than using global variables.

[Deleted]  
Andrey Miguzov:

SUS: I saw somewhere on the forum that you can also use image resources for exchange. Probably, it will be even faster than using global variables.

What is the idea? I tried resources, I didn't feel this feature.
 
Anton Zverev:
What's the idea? I have tried resources, I did not feel such a feature.
The idea is that you can calculate and write information to a resource in one Expert Advisor, and read information from the resource in another Expert Advisor(s) within one terminal. And you don't need to use files or global variables. I haven't tried it myself - global variables are enough for me.
[Deleted]  
Andrey Miguzov:
The idea is that you can calculate and write information to a resource in one Expert Advisor, and read information from the resource in another Expert Advisor(s) within one terminal. And you don't need to use files or global variables. I haven't tried it myself - global variables are enough for me.
I did not think that there is access to other people's resources.
 
Thank you for a job well done! I wanted to write something like this myself, but you wrote it even better than I could. Simple and almost ingenious. To be honest, I didn't even know that in MQL it is possible to convert structures of different sizes.
[Deleted]  
Vasiliy Sokolov:
To be honest, I didn't even know that in MQL it is possible to cast structures of different sizes.

Yes, it's a cool line

m_data=(GlobalVariablBuffer)Struct;
 
Anton Zverev:

Yeah, that's a cool line.

I wonder what would happen if you tried to reduce a large structure to a smaller one? It's scary to reproduce that.