Expert Advisors are scripts designed for the Meta Trader platform and are used to automate trading activities for a trader. Expert Advisers are typically used by algorithmic traders to automate order execution, manage positions and analyse technical indicators to decide when to buy or sell a security.
How Do they Work
for the purposes of this article, we will limit our examples of how expert advisers work to the Meta Trader platform.
In Metatrader 4, for instance, or MT4 as it is commonly known in the industry, Expert Advisers (EAs) are built using the MQL4 language that is proprietary to the MT4 platform. These EAs are typically used for developing scalping bots, volume driven buy/sell bots or any other type of bot that can automate market execution of orders.
An Expert Adviser file is typically a .ex4 or .mq4 file that is saved inside the Data Folder of your MT4 installation under the Experts directory.
Once installed, you simply drag and drop the EA from within the Navigator Window under Experts onto the chart and its ready to go. EAs make live and instant trading decisions on your account as long as your MT4 platform is turned on and connected to the internet.
What is the problem with Expert Advisors
Actually there’s no problem as such, except that they are highly over-rated by the vendors that sell such EAs claiming that they’ve finally uncovered the holy grail. There’s no such thing. EAs make decisions based on the algorithms they have been programmed with. For instance, an RSI based EA will make buy and sell decisions typically based on the RSI levels. It would place a buy order as soon as the price crosses above the over-sold line (20) or sell as soon as the price crosses below the over-bought level (80).
That’s all well and good but RSI alone should not be the deciding factor and as educated traders we must look for a secondary confirmation from another indicator such as the Moving Averages for instance.
However, assuming that the algorithm is designed well, the EA should have a good chance of making money. In order to test this, MT4 provides a simple back-testing tool whereby you can run the EA in simulation mode on historical price data.
The best practices for testing an EA and running back-test is out of the scope of this article and will be covered in another post.
Assuming that you’ve done the back-test in the strategy tester within MT4, you are now ready to go ahead and test the EA on a demo account. This is where the proverbial Sh*t hits the fan.
Why are Demo Accounts Not Good for testing EAs
First of all, most brokers, especially the dodgy dealing desk brokers run a separate demo server. They have a different price feed, completely different execution time, slippage and latency on the demo server compared to the live server. In short, trading conditions and environment on the demo server is NEVER the same as the live server with these brokers.
So being the quant genius you are, you sign up for a demo account with a broker of your choice. You run your algorithm/EA and voila you make a profit. It works.
Time to go live… not so fast presto… !
You see… depending on the strategy used by the EA to make trading decisions, slippage, execution time and latency are crucial to the success of the EA. This is especially true for EAs that trade a shorter timeframe such as M1, M5, M15, M30 or even H1 and H4.
Don’t forget…an EA is just some lines of computer code. It doesn’t have a brain. When it finds an opportunity, it sends an order to the MT4 server. The time it takes between the EA sending the order and the MT4 server executing the order is the execution time. If this is too long then by the time the order has executed, the price may have changed. This is known as slippage. If your EA was trying to scalp the market, slippage and execution delays are an absolute killer because scalping relies on a “quick in, quick out” type strategy.
Why do EAs pass the demo test but fail the Live test
The answer is very simple. Your broker activates the Slippage, Latency, Execution Delay (SLED) protocol against you. He introduces slippage by adding an extra few milliseconds to delay your order execution or worse of all, manipulates the price before executing your trade causing your EA to accept a re-quote of prices. All Dealing Desk brokers have a tool known as the Virtual Dealer plugin that is designed to do exactly that. You can read more about the Virtual Dealer plugin in my previous article where I talk about the dirty tricks brokers use to scam the trader.
By the way, these tricks aren’t exclusive to just dealing desk brokers. Most ECNs are also in this category because they are not true ECN or STP brokers like us. And then there are those that claim to be a pure STP broker only to read in their terms and conditions that they reserve the right to act as market makers if they “feel” they need to.
Manhattan Global Markets is a unique True STP Broker in the sense that it does not have any virtual dealer plugins on its network and neither are there any dodgy tricks such as the SLED protocol.
What should a trader do
As a trader, the odds are stacked against you from the very start anyway. Testing your strategies on a demo account is a waste of time if you ask me. Testing on a live account requires real money and good brokers don’t let you open an account with less than $500 starting balance.
But before you are ready to test your strategy in the real world you should be comfortable with the fact that you have back-tested your strategy with the correct price data. Don’t rely on price data in your MT4 platform from your broker. Its not accurate. Get historical prices from a reliable source such as Dukaskopy and disconnect your testing terminal from the internet when testing. This way there’s no chance of a price over-write from your broker while you’re connected to the internet.
Best practices for back-testing algos has been covered in another article I wrote recently.
Once you’re ready to go live, you can consider the following steps to ensure you get a good test from a live trading environment.
- Get a live account and place the minimum deposit. Consider your minimum deposit as risk money that you would be prepared to lose in order to test your strategy. This is an investment you’re making into your algo. If you’re not sure about your algo’s ability to execute the specific strategy you’ve developed as the base for the algo, then don’t do it.
- Trade with lowest possible risk setting not trading more than 0.5 lot at a time to keep your risk low.
- Develop a spreadsheet where you’ll record test results on an hour by hour basis for each instrument or currency pair your algo is running on.
- Don’t run your algo on more than 3 instruments at a time.
- Don’t run your algo on overlapping instruments. By that I mean, if you’re testing on EURUSD, don’t test again on USDJPY. Test on AUDJPY (not overlapping with EUR or USD) for instance.
- Choose a lower leverage setting (100:1 is best)
- Test your algorithms at different times of the day during different sessions
- Compare your live results with your backtest. If they are a close match, then you know you’re on the right track.
- Adjust, adapt, improve and continue to monitor. Don’t leave anything to chance.
Algorithmic trading is highly effective if done the right way. However, in order for the right strategy to deliver the right results, you need the right broker – a broker that does not manipulate the trading environment against you.
Do your research. Test your strategy. And most of all, don’t be naive.