New article Building an Expert Advisor using separate modules has been
When developing indicators, Expert Advisors and scripts, developers often need to create various pieces of code, which are not
directly related to the trading strategy. In this article, we consider a way to create Expert Advisors using earlier created
blocks, such as trailing, filtering and scheduling code, among others. We will see the benefits of this programming approach.
Separate modules are easier to connect/disconnect, debug and modify. Logic in OnTick will become more accessible for maintenance and
improvement if binds are implemented in one handler instead of being added in different places throughout the EA code:
This minor design change provides a clearer EA structure, which becomes intuitive. The new structure resembles the result of
application of the "Observer" pattern, though the structure itself is different from the pattern. Let's see how we can further improve
Author: Andrei Novichkov
I really liked this approach and finally some structure for an EA.
What all need to be changed to adapt it to MQL4? I'm using MQL_Easy library to develop common code for my EA on both platforms.
I'll appreciate your advice. Thanks.
To work with MQL4 you just need to try to compile the project in MT4 )))) There shouldn't be a lot of mistakes. The code is pretty