Algorithmic trading: make the machine work for you
In a world where everyone talks about machine learning and artificial intelligence, there is a place for computer-driven trading as well. It's called algorithmic (or automated) trading. In general, it is a system, which operates based on a pre-programmed algorithm. This set of rules does what is impossible to a human eye: it reacts quickly to the changes in the market and has a more systematic approach to trading. Most importantly, algo trading eliminates the negative impact of human emotions on the trading process.
Advantages of the algorithmic trading
- Your trades are executed at the best prices.
- Trades are implemented correctly and instantly.
- The system automatically checks multiple market conditions.
- It reduces the risks of manual and psychological errors usually made by the human brain.
- You can backtest the algorithmic trading strategies using historical data.
Disadvantage of the algorithmic trading
You can miss out on trades sometimes because some situations in the market haven’t been programmed beforehand.
As you can see, algo trading is a modern, quick and simple way to adapt to a fast-changing market environment.
Who uses algorithmic trading?
The power of the algorithm is applied to different investment activities and trading. It’s widely approved by mid- and long-term investors – pension funds and insurance companies. They use algo trading to purchase stocks in large quantities. For example, with the machine's help, they can buy big amounts of shares per five minutes or hour without immediate spike in a price. Thus, they help to prevent a situation when big companies impact the market heavily by their big orders. Market makers, such as brokerage houses, speculators, and arbitrage traders, also take advantage out of automated forex trading. If you are a trend trader, it is easier for you to program your trading rules in advance. The rest will be done by the program.
What does a simple trading algorithm look like?
If you are an experienced trader, it won’t take a long time for you to build a simple trading algorithm. All you need is to determine a strategy that you are going to implement.
For example, if you want to buy Gold using the Gold scalping strategy, your simplified instruction for a program will look, as follows:
Buy 0.01 lot of gold, if Williams’ Percent Range: Fast (9) and Slow (54) rise above -30.
If both fast (9) and slow (54) Williams’ Percent Range fall below -30, close your position.
If the price of gold falls by 5 pips, close your position.
Of course, in reality, a code for this strategy looks much more complicated. However, if you learn how to program this algorithm, your trades will be implemented automatically.
How to start algo trading?
If you are experienced in programming with Python, Matlab, JAVA, or C++, you can try to develop your algorithmic trading strategies. FBS traders who operate in MetaTrader 4 or MetaTrader 5 can use algorithmic trading components made with MQL. MT allows automated forex trading with the help of trading robots, also known as experts. These robots can analyze quotes of financial instruments and execute trade operations as well. If you are good at programming, you can develop a bot yourself using the MQL language.
If you want to test free robots or practice developing new ones, you can check the Code Base section in your MetaTrader terminal. This is the source of indicators and robots developed by the members of the MT community.
Another option is to open the MT market section, where you can either buy or get free custom experts, indicators, and other utilities.
Let’s consider an example of using a pre-developed expert advisor. One of the possible choices is shown on the screenshot.
After downloading the expert from the market, you can implement it to the chart right away. In the inputs, you can see its presets, which you can change, if you want to.
MetaTrader allows you to train your MQL skills and develop your expert based on the existing ones. To do that, click at the expert in the Navigator window and choose “Create in MetaEditor”. MetaEditor is a program that allows you to read and write the MQL code.
After setting everything up, you can backtest your expert based on historical prices. Open the “Strategy Tester” window by clicking “Test” (upper picture). Firstly, you need to select a pair, set a date, the size of the deposit, and even leverage for a test. After that, press the “Start” button in the right corner of your “Strategy Tester”. This action will open a visualization window of your algorithmic trading strategy.
You can either wait for it to finish the analysis, or you can scroll to a certain time by clicking on "Skip to". This way, you will get the final results of your test (lower picture). According to the received results, we could get + $110.64 with our scalping expert within a month. Not a bad result, isn’t it?
Some people say that it's impossible to operate in the markets without proper practice in quantitative finance. According to our view, the most necessary thing for a trader is to have a strict strategy. While we agree that programming may be difficult and complicated for those who have never tried it, a good strategy developed with MetaTrader tools can provide effective results even without heavy library codes.