Similar packages for equities and futures can cost over $1000 and/or have $100+ monthly subscription fees, whereas MT4 is completely free. Literally hundreds of forex brokers around the world have adopted the software as the platform of choice for their clients because of its popularity. Clients who do not want to program can use any of the advanced analysis tools in the platform. Clients who do want to program, or take advantage of the programming skills of others, can enter a worldwide community of traders and programmers who have developed hundreds of free and commercial indicators and expert advisors.
There are many reasons for why a trader should try to learn how to program an expert advisor:
- Expert advisors can trade for you 24 hrs per day without food or sleep.
- Expert advisor operate on a set of rules without greed, fear, ego or bias.
- Expert advisors helps combat emotions by getting you in and out of the market based on historically tested strategies.
- Expert advisors are able to identify and react to opportunities faster.
- Expert advisors give you the potential to trade with complex systems that can include multiple conditions for their entries and exits, profit targets, protective stops, trailing stops, and filters, and have them all automated simultaneously.
- Expert advisors can monitor many currency pairs at the same time, giving you many more trading opportunities than manual trading.
- Trading with an expert advisor is a lot easier as the robot has taken over most of the tasks of the manual trader does.
Of course, one can go out and purchase or borrow the expert advisors of others to trade with, and that is perfectly fine. But if you really want to build an edge factor into your trading, you will strive to learn to program expert advisors, so that you can add to (or hybridize) the best efforts of others and/or develop unique trading systems of your own.
There are a couple things worth noting about the Metatrader's powerful programming language, called MQL or MQL4, after the Metatrader 4.0 platform:
- MQL4 bears a similarity to programming languages such as C and Java, and thus easy to pick up by programmers. It resembles C in its procedural part and language constructs. It resembles a stripped down version of Java without classes. Programmers already familiar with C or Java might find MQL4 easy to code with. New programmers who want to code in MLQ4 might want to learn C or Java in order to learn its language faster and code better, if you have the time to do so. The problem is, learning a programming language like C or Java take a lot of time, and neither are easy languages to learn for beginners.
- MQL4 can be relatively difficult language to pick up for a beginner without prior programming knowledge. It is easier to learn than C, but not necessarily a walk in the park. MQL4 is a relatively low level programming language that requires the programmer to create custom functions and procedures for handling simple trading functions such as a trailing stop. Fear not, however, you will never be required to program these custom functions from scratch, as you can always learn from the work of others.
- Metatrader itself has many quirks that the programmer needs to be aware of, and it can take dozens of hours of troubleshooting to learn the techniques necessary to program expert advisors.
This guide seeks to help the beginning programmer how to successfully code an expert advisor. There are many tips and tricks, custom functions and procedures, that can take hours to learn, but we will hope to shorten the learning the curve by honing in on the essentials, the parts that are important to learn. Once you learn these essential parts, you will then have the ability to create huge numbers of expert advisors, depending on your time, trading knowledge and creativity, and like learning any new language or skill, the more you practice at it the more you will become fluent in all its finer details.