MQL4 - automated forex trading   /  

Forum

Hi guys

Back to topics list  | 1 2 To post a new topic, please log in or register

avatar
6
turalnba 2008.12.02 08:42 

Hi guys,

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

Thanks in advance,

article

Interview with Boris Vilenski (bablokos)

I think, for being successful, one should lead one's own way and search new solutions.


avatar
235
abstract_mind 2008.12.02 13:07 


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.




avatar
6
turalnba 2008.12.02 19:21 
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 !


avatar
235
abstract_mind 2008.12.02 21:00 
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.

avatar
6
turalnba 2008.12.02 22:22 
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 !

Attached files:
  EAmerged1.mq4 (5.97 KB)

avatar
235
abstract_mind 2008.12.03 00:39 
is this file an expert adviser or a script?

avatar
6
turalnba 2008.12.03 08:08 
abstract_mind wrote >>
is this file an expert adviser or a script?

Hello mate,

It's should be expert adviser.


avatar
235
abstract_mind 2008.12.03 12:11 
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.

avatar
6
turalnba 2008.12.03 20:51 
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 :(


avatar
235
abstract_mind 2008.12.03 21:00 


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.


avatar
6
turalnba 2008.12.04 08:09 
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 !

Back to topics list   | 1 2  

To add comments, please log in or register