merge several eas into one

 

Hello!


I have several forex robots with the source code, and I would like to merge them into one EA. 

Is there an easy way to do that?


thanks!

 
Felipe Cunha CirneI have several forex robots with the source code, and I would like to merge them into one EA. 

Is there an easy way to do that?

No, there is no easy way to do it! It requires good coding skills!

A good coder already knows the answer as to "how" to do it and is able to do it, but it is not easy and it will be time consuming (obviously dependant on the complixity of each EA)!

A less experienced coder will obviously need to hire an experienced coder to do it!

 

For the author of these programs, combining several programs into one program is a troublesome undertaking. For an experienced programmer, integrating several foreign programs into one program is an even more difficult task. But the novice can not do it at all.

 
nicholishen:

It's not as hard as everyone makes it out to be... Look at the MQL5 wizard EAs, they take a multitude of signals to trade. 

Easy or hard/difficult is a relative term! Besides, the OP states that he wants to combine Robots/EA's not Indicators/signals!

PS! He also states that he has the source code, not that he coded them himself - so obviously it will be quite difficult for him to achieve such a task!

Forum on trading, automated trading systems and testing trading strategies

Is it easy (or difficult) to …?

Fernando Carreiro, 2017.08.30 21:43

This post could be considered a “rant”, but I would like to take the opportunity to relay to those that ask similar questions, the difficulty involved in answering such a simple query – “Is it is easy (or difficult) to …?”

  • “Easy” would imply that anyone can do it, but that is obviously not the case.
  • “Easy” depends on the ability, skill, knowledge and experience of the one that is tasked to do it.
  • That ability, skill, knowledge and experience took time to establish and it had a cost, and if you sum it all up, it can be quite high.
  • So, “easy” means that if you don’t know how to do it yourself (or not able to do it yourself), then you will have to “compensate” someone else to do it for you.
  • You will be “compensating” him or her for all the effort and cost that went into acquiring the ability, skill, knowledge and experience and NOT for the actual time spent carrying out the task.

So, even if the task is just changing one line of code; remember that you are “compensating” the person for his knowledge and skills and not for just one line of code.

The same applies to those that request for something “simple” to be done for free. It is NEVER “simple”. If it were that “simple” then you would be able to do it yourself.

So, respect the hard work and effort the coder went through to gain his skills and knowledge and “compensate” him/her for it. Wanting it for free is being totally disrespectful!

PS! In conclusion, learn to use the Freelance Jobs section and recognise and respect those more skilled, knowledgeable and experienced than you!

EDIT: Please note that I use the term "compensation" and not "payment", because there are many ways to "compensate" for work done. Sometimes a coder will be "compensated" with gained or shared knowledge instead of money, or by an exchange of ideas or other things. It is not always about the money but it is about the "compensation"!


Is it easy (or difficult) to …?
Is it easy (or difficult) to …?
  • 2017.08.30
  • www.mql5.com
This post could be considered a “rant”, but I would like to take the opportunity to relay to those that ask similar questions, the difficulty invol...
 
nicholishen:

It's not as hard as everyone makes it out to be... Look at the MQL5 wizard EAs, they take a multitude of signals to trade. 

That's not serious. MQL5 Wizard is the worst example you could give, will you say mql5 wizard is easy (from coding point of view) ?

 
nicholishen:

Yes, if you understand OOP. An easy implementation for multi-EA would be as simple as creating each EA in it's own class and then calling them by order of importance.

 

 Or better you use polymorphism and each EA class derives from an EA base and implements virtual methods... 

I really don't want to offence you but merging several EAs into one is not just to make them run one after one.

 
nicholishenYes, if you understand OOP. An easy implementation for multi-EA would be as simple as creating each EA in it's own class and then calling them by order of importance. Or better you use polymorphism and each EA class derives from an EA base and implements virtual methods...

That would be highly inefficient and with each successive call the Tick Event getting more and more "stale", requiring each EA object to reacquire tick data as well as refresh any other relevant data.

For such a kind of "quick & dirty" solution, you might as well continue to run each EA separately as it is now.

The "art" is to merge and share all the common elements of each EA in order to make it more efficient both in resources and speed when compared to the separate entities! That is why it is NOT an easy task! It requires skill!

 
nicholishen: Still not hard. I hacked this together using the EA samples in no time. A little more time and one could make them communicate to combine elements. 

You still don't seem to get it! It is not about calling each one subsequently. That is slow and you yourself have commented on the problems of synchronous order processing delays and now you are advocating running entire EAs synchronously?

The OP is much better off running each EA separately on their own threads, than if he had to resort to your solution! No thank you, would be my answer if I were the OP!

Merging is about reducing the work load and amount of resources consumed, improving the efficiency and speed of the combined solution, otherwise it is not worth doing it!

 
nicholishen:

OP asked how to combine multiple EAs into one, and unlike your approach of pontificating the theoretical difficulty level, I showed him how un-difficult it actually is. In order to make it work how you think it should work would not be hard, just time-consuming. 

Easy-peasy, my friend. 

You don't know what you are talking obviously having only 'toy' approach. You don't even know what are the EA the OP wants to merge, you didn't show anything. Go and get some experience before trying to give lessons to people. They are plenty of free and paid requests on the site, you will not lack of work.

I don't doubt you are skilled, for sure you are, but your continual bragging is not welcome here. Check Google for the sense of the word 'humility', maybe you will learn something new today.

 
nicholishen:

Well, that's your opinion and you're certainly entitled to it, just like I'm entitled to have my opinion. We don't see eye to eye on this implementation (like usual), but there's no reason to call me out for bragging when I'm just expressing an opinion. I didn't call you out for the many times you've come at me lately without due diligence. Also, I don't appreciate your insults, and I can see that you desperately want to discredit me. 

Call it a toy or whatever you will but honestly I stand by my original opinion... 

There's a million ways to skin this cat, but combining EAs is not difficult, IMHO

Ok you can have your opinion and it was not correct from my part to come to personal "attack". Let's continue the personal discussion in private.

Let's be constructive. About the content : How can you say, in general, "it's easy" ? When there are infinite EAs from very simple to very complex, with all kind of strategies and money management ?

What is easy ? What is hard ?

Why do we need to discuss about it when it's obvious that the OP means "a free (or almost) way" to do it ?

Why talking about OOP in such topic ?

You find it easy, ok. You find OOP easy, perfect. But the question is not about you...For someone like the OP, as he is asking the question here, the only useful answer is : no, there is no easy way.

 
nicholishen:

We are both making assumptions about OP, and since we are on a dev forum I'm giving OP the benefit of the doubt that he knows common programming concepts, and I'm discussing OOP because it is a big part of MQL programming. 

It is for you obviously, not for vast majority of people who are trying to code (which are the ones reading this forum). Please understand me, I have nothing against OOP, I don't care, I am using any tools at my disposal to solve a specific problem in a specific situation.

OP wasn't specific but he said he wanted an easy way to merge EAs, it's very ambiguous... but the answer is yes, it's rather easy if you create a class out of the EA and output signals (instead of the actual orders) so the master EA can process the signals and do MM and Orders. Only a fraction of the code needs to be changed to implement such design pattern.  I would consider that easy, and for reference I don't have a CS pedigree, I literally learned OOP less than a year ago from C++ tutorials online.

What is a "CS pedigree" ?

So we'll have to wait for OP to chime in because if he's a coder and understands design patterns then this should be a breeze for him/her and if not then I have left some examples for future readers to potentially say, hey... that makes sense.

I do agree.
Reason: