Discussion of article "MQL5 Wizard: How to Teach an EA to Open Pending Orders at Any Price" - page 2

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
Hi @Vladimir Karputov -- that was a very instructive article, thanks for that!
I personally find this OOP framework in MQL5 quite interesting for building bots by composing objects representing experts, signals, filters, indicators, risk managers, and so on -- very elegant approach in my opinion, as it favours code reuse and extensibility without apparently sacrificing much power... however due to its complexity the learning curve seems fairly steep.
In any case, as I'm transitioning to MQL5 exclusively and have good experience in OOP concepts/languages, I am really keen to adapt it for my own use in prototyping new trading ideas and developing trading systems studying. I have been studying and playing with the library code and was wondering about your recommended best practice approach for the following:
QUESTION: How would you integrate a trend filter for signals received in the expert?
The library includes CExpertBase::m_trend_type property but unfortunately it is not really used anywhere in the examples provided with the platform. I am divided between two design possibilities... Adding a trend filtering object directly in my subclass of CExpert (see code snippet below), which could offer more control on making trading decisions at the level of the expert. Another way to solve it could involve fiddling with the filters of my main signal object and somehow calculate the trend and make a decision inside my subclass of CSignalExpert, e.g. inside CSignalWithTrendFilter::Direction(). Not quite sure yet what are the advantages and disadvantages of one method versus the other, and which one will provide me with more flexibility for requirements of my future projects, i.e. more code reuse without complications and less tweaking of my base classes.
Thanks in advance for you help and recommendations.
I switched to my trading engine a long time ago An attempt at developing an EA constructor - it's more flexible.
OK, I see -- I'm reading the article and will have a look at the attached code... in any case, I'd still appreciate your comment/opinion on the question above if you don't mind. Thanks a lot!
OK, I see -- I'm reading the article and will have a look at the attached code... in any case, I'd still appreciate your comment/opinion on the question above if you don't mind. Thanks a lot!
CExpertSignal is the past. No comments.
CExpertSignal is the past. No comments.
:-)