Hi guys

 

Hi guys,

I need help, how to merge 3 mq4s, anyone can help me out ?

Thanks in advance,

 

each EA has a start() function.

1- For each of these EAS, rename start functions

EA1: start() ---> start_1()

EA2: start() ---> start_2()

EA3: start() ---> start_3()


2- Merge the EAS in a new FILE called mergedEA.mql4 (or anything you like)


3- Create a new start() function for this EA, like this:


int start()

{

start_1();

start_2();

start_3();

}

4 - Eventally, each EAs might have code of functions that are repeated in the other EAs. This is to say that you have to delete any repeated function in the merged EA.

 
abstract_mind wrote >>

each EA has a start() function.

1- For each of these EAS, rename start functions

EA1: start() ---> start_1()

EA2: start() ---> start_2()

EA3: start() ---> start_3()

2- Merge the EAS in a new FILE called mergedEA.mql4 (or anything you like)

3- Create a new start() function for this EA, like this:

int start()

{

start_1();

start_2();

start_3();

}

4 - Eventally, each EAs might have code of functions that are repeated in the other EAs. This is to say that you have to delete any repeated function in the merged EA.

Thanks for your quick response,

I did as you said, it works fine . But there is a little confusion . My strategy is to open some orders then put there close all oders after reaching some profit, and then open some oders again . Now the confusion is, it does my 1st step and 3rd step togeather, for example, (1st step ) I buy USD/CAD and (2nd step) reach profit to close it and (3rd step) open new order (sell USD/CAD) .

So what it does, is it opens new order Sell USD/CAD also Open new oder Buy USD/CAD in the same time and then it waits for profit to close them.

Sorry bothering you mate if helpme out again ' LL be great, cheers !

 
It seems a problem of coordination between the several strategies. I cannot help you, without looking at the code. So, if you could put here relevant/problematic fragments of your code, I might see what is happening.
 
abstract_mind wrote >>
It seems a problem of coordination between the several strategies. I cannot help you, without looking at the code. So, if you could put here relevant/problematic fragments of your code, I might see what is happening.

Thanks a lot, see what can do please. And also is it possible to repeat the operation ? I mean like, after 1 2 3 steps, again start from 1 . Example, Buy 2 couples of currencies, wait for the profit one it's been reached the profit, close all orders open the new orders again wait for the profit, then close ......and so on,

Cheers !

Files:
eamerged1.mq4  6 kb
 
is this file an expert adviser or a script?
 
abstract_mind wrote >>
is this file an expert adviser or a script?

Hello mate,

It's should be expert adviser.

 
It seems that it was built from a script. Here is some issues: code that is in init() function only works at EA's startup; code that you want to execute at each currency's tick should be inside start() function. See and try to fix it ; I may help you a bit more later.
 
abstract_mind wrote >>
It seems that it was built from a script. Here is some issues: code that is in init() function only works at EA's startup; code that you want to execute at each currency's tick should be inside start() function. See and try to fix it ; I may help you a bit more later.

Sorry mate, I didn't work, Its the same :(

 

In order to debug what is happening, put some Print("djfsdfjjk comments sdfjfk"); at sections of the code that you think should/should not be working. See the effects at the Experts TAB and try to figure out what's happening.

I can help you more, but later on.

 
abstract_mind wrote >>

In order to debug what is happening, put some Print("djfsdfjjk comments sdfjfk"); at sections of the code that you think should/should not be working. See the effects at the Experts TAB and try to figure out what's happening.

I can help you more, but later on.

Sorry mate, I didn't understan you . Coz I 'm quite new in this fild . But Thanks your respond, I 'll wait for your futher help.

It will be great if you work out on the attechment that I sent to you of course when u have time (I am not in a rush). And you know what I want to do. See can you do something .

Cheers, all the best !