Combining two expert advisors

 

hello everyone,

is there a way one can combine two expert advisors using different magic numbers? I know I can write them all into one file, but as they are, separate is there a way that they can be combined, without writing them into one file??


thanks

 
nduru22:

hello everyone,

is there a way one can combine two expert advisors using different magic numbers? I know I can write them all into one file, but as they are, separate is there a way that they can be combined, without writing them into one file??

What do you mean by "combined" ?
 
RaptorUK:
What do you mean by "combined" ?


I mean, lets say you have one expert that is trending and another that is counter trending, how would you combine them such that they become one? want to find out if there is another way of doing it other than writing the two advisors into a single file...
 
nduru22:

I mean, lets say you have one expert that is trending and another that is counter trending, how would you combine them such that they become one? want to find out if there is another way of doing it other than writing the two advisors into a single file...
If they are well written using discrete functions then maybe you could call one set of functions from the other EA,  but I suspect the easiest way would be to combine the two lots of code into one EA.
 
RaptorUK:
If they are well written using discrete functions then maybe you could call one set of functions from the other EA,  but I suspect the easiest way would be to combine the two lots of code into one EA.


How do I call a function in expert advisor A in expert advisor B?
 
nduru22:

How do I call a function in expert advisor A in expert advisor B?

Have the functions been well written ?  do they make little use of globally declared variables ?

Importing of functions 

 
RaptorUK:

Have the functions been well written ?  do they make little use of globally declared variables ?

Importing of functions 



thanks let me have a look. Yes they have been written well, but they make some good use of global variables, would that give me an issue?
 
nduru22:


thanks let me have a look. Yes they have been written well, but they make some good use of global variables, would that give me an issue?
If the 2 EAs use the same globally declared variable names (not to be confused with Global Variables) but meaning different things then you will have problems using them.
 
RaptorUK:
If the 2 EAs use the same globally declared variable names (not to be confused with Global Variables) but meaning different things then you will have problems using them.



Ah okay, i think i have globally declared variable names, that mean different things, let me check on that then. Thank you
Reason: