​This is the easiest step; you will need to own MT4 and MQL4, as well as registering the former with a broker that supports it.
After doing so, make sure to open a demo account; do not test your EA with a real account!
​The MQL4 syntax is like C++ or PHP, so you are likely to understand it fairly quickly if you are tech-savvy or familiar with some programming languages.
You will need to learn which words trigger which behaviors and how to communicate with the script to make your EA work. Luckily, MQL4 comes with elements like predefined variables, which make coding much easier.
After coding your EA, you can use the MetaEditor which comes with MT4 to access more options. In addition, you will need to use the MetaEditor to save your EA if you are using an external bot editor.
After familiarizing yourself with MQL4, you need to apply your knowledge to set it up correctly.
You need your EA to follow your strategies just like you would - or your idols do - so bring out your indicators and plan your approach appropriately.
First, you need to program your bot how to recognize your entries by identifying possible crosses, supports, and resistances in the future and entering based on them. Do the same for the exits, and your trading robot will be good to go.
You can touch upon money management as well, as MQL4 lets you specify lot sizes and even which percentage of your account’s funds you want to use per trade. If that is not enough, you can use OrderModify functions to give the EA the option to break even on losing trades.
After you are done, you can place your trading bot on the “Experts” directory of your MetaTrader installation folder. You will find it on your navigation menu - left side - under “experts”.
​You can test your trading robot on past market conditions straight from the MT4 environment, but it should not be your sole testing ground for your EA.
That is why we asked you to open a demo account; the only real proof for an EA’s success is the real market - just remember to keep your ego aside and acknowledge when your strategy fails.
​Today, there are even programs and websites that help you skip programming altogether!
The first option is a builder, which gives you an interface to input all your specifications for your strategy and the program feeds it to the script without you having to type a line of code.
The last option is a generator, which almost helps you skip learning Forex! Generators can come up with millions of strategies and variations and feed them to the EA - testing included.