Hi,
I have an EA that I'd like to use as a master EA. Through this EA I only want to change the indicator or signal that I want to use without creating a new EA and copy paste the master EA. I know some people used an include files to do it, is there a comprehensive article that I can use to understand this workflow?
- Do I need mql4 code to create ea?
- how to call a custom indicator to ea ?
- Indicator and EA, in just one binary.
Hard to say - I don't quite get your question. But it sounds to me like you might want to read some programming book for c++ about patterns.
Well, putting functions in an mqh and calling them from an Indicator or EA is the most normal thing.
When you start coding you put everything in one program. But that gets chaotic pretty soon.
So you continue wrapping the functionality that you want in functions whose bodies are outside of the program in question, but they can be called from within the program.
At some point you externalise them into includes, so you have them in a constant place where you can always find them for later projects.
If you would like to have all the functionality of one Indicator in one place, you need to make a function for initialisation, a function for getting values, boolean function for conditions that you want to use regularly.
Then there is the object oriented way of programming where you can work with encapsulation and inheritance. And of course you can make multiple objects of one class.
What is your personal state of the art?
Just like tobias saying, currently I put everything in one program. If I want to create new EA I will copy and paste the old EA to the new one.
To reduce this hassle I want to move anything that related to signal into a mqh file and when I want to test new idea, instead of creating lots of new EA I just need to change the signal from include files.
I tried moving an indicator and a entry signal in a new include files and all of the variables to another include files. It works great and it suits what I need currently but I think it can be better. So, I just curious if there's an article that will explaining a detail or a workflow how seasoned programmer manage all of that.
Luandre Ezra #:
I tried moving an indicator and a entry signal in a new include files and all of the variables to another include files. It works great and it suits what I need currently but I think it can be better.
It is really hard to give just one advice that will be THE most helpful. First I don't know where you are at exactly without having a full blown conversation about everything and nothing. It is about concepts, techniques, organisation... It might work better in a real conversation and in private.
Edit: Oh well, you can look in Codebase, particularly in Libraries https://www.mql5.com/en/code/mt5/libraries/page7
there is a whole bunch of these, they might be just what is helpful to you.
IncEnvelopesOnArray
- www.mql5.com
The CEnvelopesOnArray class is intended for calculation of Envelopes on an indicator buffer.
Luandre Ezra #:
Just like tobias saying, currently I put everything in one program. If I want to create new EA I will copy and paste the old EA to the new one.
Just like tobias saying, currently I put everything in one program. If I want to create new EA I will copy and paste the old EA to the new one.
To reduce this hassle I want to move anything that related to signal into a mqh file and when I want to test new idea, instead of creating lots of new EA I just need to change the signal from include files.
I tried moving an indicator and a entry signal in a new include files and all of the variables to another include files. It works great and it suits what I need currently but I think it can be better. So, I just curious if there's an article that will explaining a detail or a workflow how seasoned programmer manage all of that.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register