MetaTrader Expert Advisor - The Benefits of Algorithmic Trading and Forex EAs

Ashley Jessen - Chief Operating Officer

2024-01-29 11:20:30

Welcome to the world of creating automated systems using Metatrader Expert Advisors. The last few years have been the year of Artificial Intelligence and algorithmic trading.

Many may think trading the global markets using algos is a 'new invention'. But you may be interested to know the most successful and richest fund manager, Jim Simons, uses purely quantitative methods, generating 66% annually for 30 straight years (1988 to 2018). His income in 2021 from running his fund was $3.4 billion.

So, you might be wondering, what is involved with creating your own Expert Advisors to seamlessly execute your trades into the market 24 hours a day, 5 days a week?

Before we dive into that, it is interesting to note how active the institutional trading desks are in using algorithmic systems to execute their trades into the market.

According to a Greenwich Associates study, the proportion of spot FX traded with an algorithm by corporates shot up to 28% in 2016, from only 10% in 2015. Recent reports suggest that figure is now at 30%.

What is a Forex Expert Advisor (EA)?

You have no doubt heard the term Expert Advisor brandied around on trading forums around the world. They are becoming more and more popular for several key reasons. Before we get into the benefits of automated trading with your own Metatrader 4 expert advisor, let's discuss what they are.

An Expert Advisor (EA) is a process in which you code your complete trading system into the computer in order for it to be executed on your behalf.

What can be coded into your Metatrader trading EAs?

Basically, every component of your trading system can be coded into your Metatrader expert advisor.

This means you will need to identify your:

  • Entry criteria
  • In profit exit criteria (including trailing stops)
  • In loss exit criteria
  • Position sizing rules
  • Money management rules
  • Breakeven rules

As you can appreciate, this is well suited to those who have created or are in the process of creating mechanical trading systems.

Mechanical systems have precise entry, exit and position sizing rules with no grey areas.

The other alternative is a discretionary trading system. A discretionary system can have grey areas, which are essentially rules or trading ideas that cannot be automatically executed by a computer.

An example of a mechanical trading system or simple expert advisor system would be to buy 1 lot of the EURUSD forex pair if the 5-period moving average crosses up through the 20-period moving average and close the trade when the 5-period moving average crosses back below the 20-period moving average.

An example of a discretionary system is where you might decide to buy double your normal position size because volatility is low across the markets you are trading. This meant you had to manually look at the relevant markets to see it met your criteria and then decide if you should place a normal size trade or more based on the volatility.

Automating your trading system

The benefit of creating your own trading robot is so all the order placing can be executed by your computer. You no longer must be there entering in every buy and sell order or adjusting your stop loss as the market moves higher.

Every single aspect of your system can be coded in. And the good part is the EAs operation removes the emotional aspect us humans have when faced with the fear of placing trades.

The MQL4 language is built by the Metaquotes software corp, who build the MT4 and MT5 trading platforms. And it is for this reason the MT4 platform has become one of the most dominant Forex platforms in the market today. You can download Metatrader here.

What programming language is used with MT4?

The Metatrader trading platform uses the MQL4 programming language, which is an object-oriented programming language. Many suggest the language used is closest to the C and C++ programming language.

The basics of creating the best Expert Advisor to gain an edge

You can already see the global FX institutions are using programming tools to create their automated trading systems into the market.

One of the reasons for this is they have a number of Quants who can identify positive expectancy trading ideas and back-test them quickly. You can use the strategy tester within MT4 to test your own systems using historical information too.

Once the back-test results prove there is an edge, it needs to be executed into the market. Now imagine if you had 5-10 of these positive expectancy trading systems. You may be completely overwhelmed when many entry or exit signals trigger at once.

So, they get coded into their respective trading software such as MT4 so they never miss a signal.

Top 5 benefits of using a Forex trading robot to execute your trades

  1. You can focus on creating positive expectancy trading systems.
  2. Computers are much faster at responding to alerts than humans.
  3. Never miss a trading signal. Your EA never sleeps.
  4. You no longer have to be glued to your computer screen.
  5. Remove the emotional element of entering or exiting the market.

As traders, humans have several behavioural biases which lead to mistakes. When it comes to trading, those mistakes can mean thousands of dollars.

Therefore, it goes without saying that if you have a tendency to override your own trading signals or miss signals for various discretionary reasons, building your own Expert Advisors might be the best thing for you.

What types of automated Forex trading strategies can you create?

As you can appreciate, you are only limited by your creativity, knowledge of the markets and ability to code.

Most importantly, it is critical to create your trading algorithms to the market conditions you are looking to trade. Experienced traders know that trading opportunities are different for trending markets vs range bound markets.

For example, if your EA is designed to trade range bound markets, then the best indicators for Metatrader 4 to use would be your oscillators.

When you get more trading experience in the forex markets, then you will also want to backtest fully automated trend following systems as well.

Professional system trading and building trading bots is all about coming up with simple ideas based on your trading needs.

And know that trading indicators are only mathematical formulas based on price and volume data. They are a trading tool to help you build different expert advisors in Metatrader 4 or Metatrader 5.

But even then, there are forums you can access to hire a MT4 programmer or MT5 programmer to build your trading system and ideas into an EA.

Here are some types of trading styles to get your mind thinking:

  • Creating an EA to trade news releases. You can view the Economic Calendar here to see all the major events coming up.
  • Create a high frequency trading bot to take advantage of small price movements when the momentum of the market is clear. High-frequency trading is usually left for those with the computer power and proximity to the server, as trades come down to milliseconds.
  • A moving average cross over system or MA cross (as mentioned above). Nearly every trader starts with this style of basic trading strategy.
  • For those active traders, you could build a scalping trading EA where you scalp the market for small gains.
  • Any form of technical analysis such as overbought/oversold indicators (i.e. stochastic oscillator), wave analysis or any combination of technical indicators.
  • You can build your own custom indicators and include them in your EA.
  • Chart pattern based EAs such as ascending triangles (although many argue this style of trading is best left to discretionary traders).
  • Breakout expert advisors.
  • Pairs trading expert advisors. Pairs trading is where you will go long one instrument such as the DAX index and short the S&P500 index based on markets getting out of correlation.

You will need a Forex Virtual Private Server (VPS) for your EA Trading

Forex EAs are executed via your Forex broker on your live trading account. But the signals are kept on your local machine and do not sit on your brokers servers.

Therefore, you will either need to have your PC on 24/5 or you can do what nearly every other automated Forex trader does and that is utilise the Forex VPS service available.

Automated Forex traders need connectivity and reliability. And it is for this reason that professionals do not rely on their home PC setup.

You are best off using a Forex VPS service to execute your automated Forex trading systems. Do not compromise on this. Missed trades or missed stops can cost you thousands of dollars. So be sure to use a VPS service that has outstanding uptime and reliability.

Exploring Expert Advisors on MQL5.com Marketplace

For traders, especially those new to the arena, the MQL5.com marketplace offers an invaluable resource for acquiring every type of EA you can imagine.

MQL5.com is a comprehensive platform that hosts hundreds of the best forex EAs, catering to a wide array of trading styles and timeframes.

This marketplace is not just a purchasing platform; it's an educational journey for anyone diving into the world of automated trading. Here, you can explore and compare various EAs, each designed with specific trading strategies and goals in mind.

The Range of Expert Advisors

What makes MQL5.com stand out is the sheer diversity of EAs available.

Whether you’re interested in long-term trend following, short-term scalping, or specific strategies like grid or martingale, the marketplace has options to suit every trader’s needs.

This variety allows traders to select an EA that resonates with their trading style and risk tolerance.

Importance of Reviews and Comments

A crucial aspect of the MQL5.com marketplace is the community feedback.

Each EA comes with reviews and comments from other users. This feature is particularly beneficial for those new to trading, as it provides real-user experiences and insights.

Before making a purchase, it's advisable to thoroughly read these reviews and comments.

They not only offer a glimpse into the EA’s performance but also highlight any potential issues or benefits that might not be immediately apparent.

Transitioning to Automated Trading

For many traders, the leap from manual trading to automated trading can be daunting. Purchasing an EA from MQL5.com can be a significant first step in this transition. Most EA developers allow you to download a demo version of their EA, so make use of that.

These ready-made trading robots offer a glimpse into the world of algorithmic trading without the need for building an EA from scratch.

Getting started with your own Expert Advisor

You may be asking, 'Is automated forex trading for beginners or solely for professional traders?'.

The truth is, everyone starts at the beginning. So even if you are new to trading, getting to know and start the process of building your own Expert Advisors is key.

One thing is for sure. Professional traders and fund managers have been using automated trading models more and more frequently.

So now is the time for you to get started no matter your level of experience.

The way most get started is setting up a demo account with a trading firm like ACY and start testing your EA. Once you are comfortable with the backtesting and live demo results and it aligns with your risk management, you can upgrade to a live Forex account.

At ACY, we offer trading conditions ideally suited for traders using Expert Advisors. With spreads starting from 0.0 pips on the EURUSD, and tight spreads on Gold, our deep liquidity and competitive pricing is ideal for the serious EA trader.

This content may have been written by a third party. ACY makes no representation or warranty and assumes no liability as to the accuracy or completeness of the information provided, nor any loss arising from any investment based on a recommendation, forecast or other information supplied by any third-party. This content is information only, and does not constitute financial, investment or other advice on which you can rely.

ผู้เขียน

Ashley Jessen is the author of CFDs Made Simple and Chief Operating Officer at ACY Securities. Jessen started in the industry in the year 2000, has educated thousands of traders globally, and has been instrumental in the growth of many of the world's largest CFD & FX companies.

ราคาเป็นตัวบ่งชี้เท่านั้น