I contacted forty MetaTrader programmers, if not more, and asked them one question.
Can any trading strategy be coded into MT4 robot?
Their answers are quite interested. Read them below.
However, what was more interesting is that only 10 of them responded. So this explains why many people tell me that it is very hard to find a good MQL4 programmer, or even the one that will respond to your request.
I appreciate and thank a lot to those who responded to my question. It tells us that all of these programmers are dedicated to their work.
Responses listed in the order they were received.
Gosta Hulden, director/programmer
Most strategies can be automated. I often get the question from clients “Is it possible to…” and more often than not the answer is “yes absolutely”. But of course there are exceptions. For example, some fundamental strategies might be more advanced than just reading a news result from a news web site and acting on it, hence it would require some manual input. But as a guide line I tell my clients; “When writing your specification, assume that anything is possible. Most of the time it will be, and if not I will let you know”. And in those cases when a strategy cannot be fully automated it is often possible to create semi-automated tools that are extremely helpful for the trader.
Owner & Chief Programmer
From our point of view the answer is ‘YES’ in absolute terms and ‘NO’ in practical terms. ‘Yes’ in absolute terms, because trading strategies are often based on the analysis of certain variables and patterns that can be translated into MQL4. ‘No’ in practical terms, because there are some trading strategies that due to its complexity would imply a cost in time and money difficult to assume by the customer and programmer respectively.
Zoltan Laszlo Ferenci, owner
An EA can do any trading transaction as a human can do, and it can execute strategies based on complex rules, but it has some limitation which a human doesn’t have. For example, for many years no programmer were able to develop a chess computer that won over the chess world championship. The reason was that while a computer is able to compute and compare millions of step variations and chess positions, a human thinks in strategy, and is able to change the strategy according to experiences. The latest brain science shows that the brain may change it’s own structure according to the current needs, this is never be able to be done by a computer. A trader can use an EA effectively by knowing this limitation and by using it to execute everything that can be fully automatized (saving precious time for the trader), while taking control, and change the strategy (ask the developer to alter the software) when needed.
My answer has two parts, one theory, one practice.
MQL is a complete programming language (Turing complete, as the academics say), so any strategy that is computable can be coded as an MT4 Expert Advisor. To be computable, a strategy must be expressible as well-defined rules consisting of stored values, math operations, if-then conditionals, and looping. Subjective strategies are not computable. For example, a method that trades based on subjective interpretations of central banker arcana is not computable by machines.
Subjectivity aside, MT4 Expert Advisors are, in theory, as capable as any machine. But trading is real world, not theory. In practice, data availability and performance can make MT4 unsuitable for particular assets and strategies. For example, MT4 is not a suitable platform for a high frequency trading strategy capable of tens of thousands of trades per second. Although the logic of such a strategy could be coded as an MT4 Expert Advisor, slow performance would defeat the purpose.
There are very few technical hurdles to overcome when programing trading strategies. On the rare occasion a client may need something outside of the normal such as having a machine read a webpage (and understanding it) or scanning Twitter for chat to see “what’s hot”. These are very complex tasks that take a great deal of specialist programming and are beyond the budget of most MT4 traders. But in general, nearly everything that people think of can be coded.
The one grey-area that catches people out is the discretionary portion of their idea. They might say “when a trend looks like ending”, which is something that a human understands as a concept but a computer cannot. A computer needs rules to be able to declare if a trend (what is a “trend”) is ending (how does it come to an “end”). You actually need a set of rules first to say what a trend is, how to measure if it is there, and then to decide how to measure if it is ending. These rules must be in the specification for the job, because a programmer cannot just adlib these rules, for if he does he is writing his own strategy, not the client’s.
Head developer of the EA-builder
Our team at EA-builder.net can automate any trading strategy as long as it is clearly defined by concise rules for placing, managing and closing the trades. We can also help with suggestions for improving your system or diversifying your ideas. So far we have built hundreds of EAs, from very simple ones that use 1 or 2 indicators as signal triggers to more complex strategies that do multi-instrument correlations or use artificial intelligence. News trading EAs, hedge strategies, grid systems, you name it, we’ve done it.
Most traders have not boiled down their strategies to a series of if-then statements. They know what they do as a rule, but have a very difficult time expressing it. There is no limit to programming strategies if the trader overcomes the hurdle of communicating his idea. We can code anything that can be quantified with numbers.
Jan Jablonski, CEO
MT4 Expert Advisors have a lot of possibilities to code almost any strategy idea of the trader, which base on information (feed data) coming from MT4 platform. Of course, we can use all indicators which are based on historical and current feed data. There can be one problem with using historical tick data because this information is not available in MT4 platform. This problem can be resolved by collecting thick data which are coming in real time. Second thing is that we have also no access to depth of market what can be also useful in some situations.
Next thing is if the trading strategy is based on any data from other application or from other internet service, then in pure MQL (language to code MT4 Expert Advisors) it can be a problem to code such idea. But in fact it is not a big problem, because in MT4 Expert Advisors we can use external DLL files which can be created by using other (more advanced) programming language like C/C++ or C#. In DLL file we can code any connection between Expert Advisor and other application. In fact, with this possibility we are able to code any trading strategy, which will be used on MT4 platform. The only one limitation may be access to data which we would like to use.
I believe that nearly any trading strategy can be coded into a MetaTrader4 Expert Advisor. Strategies based on High Frequency Trading (HFT) are unlikely to be effective in MT4 EAs because of the speed factor. However, strategies based sophisticated analytical methods are definitely code-able. In my own experience the more sophisticated the strategy, the more likely that it can benefit from moving complex functions into a DLL accessed from the EA.
MT4 DLL access is based on unmanaged code. Therefore, when using DLLs developed with C# or VB.NET, it is necessary to coordinate functions using a bridge. Whether coding exclusively in an EA or in conjunction with DLLs, it is helpful for clients to understand that sophisticated strategies are complex and time-consuming (even for those who know what they are doing). Clear instructions, timely response, multiple revisions are essential to the success of any project.
Emet Trading Solutions, CEO
Any trading strategy of any complexity can be coded into MT4. This may include setups based on indicators, price actions, candlestick patterns, visual manipulation of MT4 objects (like trading based on trendlines, arrows, fibos, etc.) In order to create an automated trading system, one has to have a clear set of guidelines for opening, closing and handling orders. The benefits of trading with an EA is to handle your trading with the manually unachievable speed, accuracy and frequency as well as trading non stop 24/5 a week.
Forex trader, programmer, author
I would like to add my answer to the same question as well. Even though I’ve created the most advanced software for currency traders on MT4, there are still things that I would not dare to program. I am not saying it’s mission impossible, but I don’t believe it can be programmed to fit everyone’s needs.
For me, things like drawing of the trend lines and divergences, is something I never dare to program. This is simply because every human being will see this differently and we all know, that computers cannot see things the same way our eyes see. Robots cannot have the same imagination. So for someone, a trendline drawn from A to B, might look inappropriate, while others would simply draw it from C to D.
Then there will be people who will never draw trend lines in those places and rather choose to draw it from E to F, etc. That’s why my Trendline Trader EA for MT4 is not fully automated, and the job to draw a trend line is left to the trader. It’s trader’s decision where and how to draw the trendline and I think you will agree that this is mostly what will dictate your success.
The same with divergence lines. I know there are indicators for that, but if you try them, you will find that they will not draw the same divergences you want to see. There will be less or more divergences.
I believe this is because human mind simply dismiss some of the trend lines or divergences because of a sixth sense, or trader’s intuition (call it any way you like).
Any feedback is welcome in the comments below.
Now tell us, what do you think. Can any trading strategy be coded into MT4 robot?