moving values between EA's with GV's

 

Hello, I have a problem with using Global Variables. Thanks for taking a look.

The requirement is fairly simple (i think), but for me it is difficult to implement.
I have tried myself and hired programmers from around the globe, some have a go at doing it but don't
actually code what i need or they don't understand the requirement.
I can do a bit of simple programming but i just don't 'get' (terminal) Global Variables.

Maybe someone can help. If you're a programmer
and would like to help, I'm happy to pay for your expertise.

Anyhow here's what i'd like to do.
Assume several instances of the EA running on the terminal.
Currently I have a GV that interrogates other instances at order signal and imports a value from the instance that meets a criteria.
Now what needs to happen is the instance that imports the value runs a calculation on that value.
The output then needs to be sent back to the instance where the initial value was originally generated.

So, lets say we have variable 'a', it holds the value to be found by the GV.

Assume GV running in instance 1 imports the value 'a', from instance 3.
Then instance 1 that found the 'a' value in instance 3 runs a calculation on the value
and puts the result in variable 'b'.
It then needs to send the 'b' value back to instance 3.

Then instance 1 and 3 uses the 'b' value further in their own calculations.

I think it can be implemented, but if someone who knows can confirm I'd really appreciate it.
Maybe someone could suggest a framework for the code i should use?
Would someone like to do the actual programming?
Or, if someone knows where GV's are explained in simple laymen's terms?
(I mean explaining in not mql language)

Thanks for any help, really appreciated.

 

Good morning 

I would suggest using a back and forth system with files .
From what i understand you have a "master" instance and all others are sub instances of the same "tool"

Use each instances "encoding" in the folder name . For example instance 3 is "ExpertNameUSDJPYM15".

You will have one file for transfering the data values back and forth , and 2 trigger files .

With on Timer you check every 5 seconds for the existence of these trigger files .

The master instance looks for the file "MasterRead" , deletes it the moment it finds it , opens the data file processes it ,writes it back
and finishes by creating the second trigger file "SubRead"

The sub instance looks for the file "SubRead" , deletes it the moment it finds it , opens the data file processes it writes it back , if 
communication with the master is needed it creates the first trigger file "MasterRead".

Global Variables may be more helpful and faster though , if someone can point you to their proper usage you should go with that solution.

 
Lorentzos Roussos:

Good morning 

I would suggest using a back and forth system with files .
From what i understand you have a "master" instance and all others are sub instances of the same "tool"

Use each instances "encoding" in the folder name . For example instance 3 is "ExpertNameUSDJPYM15".

You will have one file for transfering the data values back and forth , and 2 trigger files .

With on Timer you check every 5 seconds for the existence of these trigger files .

The master instance looks for the file "MasterRead" , deletes it the moment it finds it , opens the data file processes it ,writes it back
and finishes by creating the second trigger file "SubRead"

The sub instance looks for the file "SubRead" , deletes it the moment it finds it , opens the data file processes it writes it back , if 
communication with the master is needed it creates the first trigger file "MasterRead".

Global Variables may be more helpful and faster though , if someone can point you to their proper usage you should go with that solution.

Hi,
Thanks for taking the time to comment.
I'll look into using a file system such as you suggest, it sounds like a possible solution,
I may have to go with something like that.
No, there isn't a 'master' instance. It's just when any instance generates a signal
to place a new trade, it first of all checks the 'a' variable of the other instances.
The criteria is just to find the highest value, which is as far as i've got with my GV.

Reason: