IMPLEMENTATION OF A TRADING ADVISOR FOR THE METATRADER 5 MULTI-MARKET PLATFORM
Abstract
The article describes the process of creating a flexible trading strategy for algorithmic trading in a specialized development environment MQL5 IDE in the MetaTrader 5 multi-asset platform. The advantages and expediency of using the MetaTrader 5, MetaTrader 4 platforms and their respective trading applications Trade Assistant, Forex Trade Manager, Trade Time Manager, CAP Gold Albatross EA and Fast Copy are shown. A comparative analysis of the existing implementations of trading advisors based on various indicators, as well as those created using intelligent technologies, has been carried out. In the previously implemented trading advisors, for predicting the prices of the volatility of financial assets, flexible learning algorithms, compensatory fuzzy logic models, and technical analysis tools are mainly used, which entails high time costs, in conditions of high financial market volatility. To solve this problem, the authors propose an integrated approach based on the use of technical analysis tools built into the MetaTrader 5 multimedia platform and the trading strategy automation algorithm, which makes it possible to obtain a forecast of a given accuracy for the selected instrument in real time. The paper substantiates the need to introduce elements of automatic trading when analyzing the quotes of financial instruments and managing a trading account in order to avoid mechanical, analytical, organizational and psychological mistakes made by traders. The study shows step by step the process of creating, debugging, testing, optimizing and executing the implemented trading advisor. An algorithm for automating a trading strategy has been developed and its block diagram has been presented. The initial data for the trading strategy automation algorithm are determined, and the mathematical apparatus for calculating indicators of limit orders of the TakeProfit and StopLoss types is described. Since exchange trading is associated with many risks, we analyzed the impact of different values of lots of TakeProfit and StopLoss limit orders on possible profit and drawdown limit (loss). As a result, the EA worked correctly in real time without human intervention for eightweeks using two trading strategies. The results of testing the developed software allow us to draw the following conclusions: when the EA shows a high degree of recommendation, the actual financial assets show high efficiency.








