Articles on the MQL5 programming and use of trading robots

icon

Expert Advisors created for the MetaTrader platform perform a variety of functions implemented by their developers. Trading robots can track financial symbols 24 hours a day, copy deals, create and send reports, analyze news and even provide specific custom graphical interface.

The articles describe programming techniques, mathematical ideas for data processing, tips on creating and ordering of trading robots.

Add a new article
latest | best
preview
Automating Trading Strategies in MQL5 (Part 40): Fibonacci Retracement Trading with Custom Levels

Automating Trading Strategies in MQL5 (Part 40): Fibonacci Retracement Trading with Custom Levels

In this article, we build an MQL5 Expert Advisor for Fibonacci retracement trading, using either daily candle ranges or lookback arrays to calculate custom levels like 50% and 61.8% for entries, determining bullish or bearish setups based on close vs. open. The system triggers buys or sells on price crossings of levels with max trades per level, optional closure on new Fib calcs, points-based trailing stops after a min profit threshold, and SL/TP buffers as percentages of the range.
preview
Markets Positioning Codex in MQL5 (Part 1): Bitwise Learning for Nvidia

Markets Positioning Codex in MQL5 (Part 1): Bitwise Learning for Nvidia

We commence a new article series that builds upon our earlier efforts laid out in the MQL5 Wizard series, by taking them further as we step up our approach to systematic trading and strategy testing. Within these new series, we’ll concentrate our focus on Expert Advisors that are coded to hold only a single type of position - primarily longs. Focusing on just one market trend can simplify analysis, lessen strategy complexity and expose some key insights, especially when dealing in assets beyond forex. Our series, therefore, will investigate if this is effective in equities and other non-forex assets, where long only systems usually correlate well with smart money or institution strategies.
preview
From Novice to Expert: Time Filtered Trading

From Novice to Expert: Time Filtered Trading

Just because ticks are constantly flowing in doesn’t mean every moment is an opportunity to trade. Today, we take an in-depth study into the art of timing—focusing on developing a time isolation algorithm to help traders identify and trade within their most favorable market windows. Cultivating this discipline allows retail traders to synchronize more closely with institutional timing, where precision and patience often define success. Join this discussion as we explore the science of timing and selective trading through the analytical capabilities of MQL5.
preview
Building AI-Powered Trading Systems in MQL5 (Part 5): Adding a Collapsible Sidebar with Chat Popups

Building AI-Powered Trading Systems in MQL5 (Part 5): Adding a Collapsible Sidebar with Chat Popups

In Part 5 of our MQL5 AI trading system series, we enhance the ChatGPT-integrated Expert Advisor by introducing a collapsible sidebar, improving navigation with small and large history popups for seamless chat selection, while maintaining multiline input handling, persistent encrypted chat storage, and AI-driven trade signal generation from chart data.
preview
Neural Networks in Trading: Memory Augmented Context-Aware Learning for Cryptocurrency Markets (Final Part)

Neural Networks in Trading: Memory Augmented Context-Aware Learning for Cryptocurrency Markets (Final Part)

The MacroHFT framework for high-frequency cryptocurrency trading uses context-aware reinforcement learning and memory to adapt to dynamic market conditions. At the end of this article, we will test the implemented approaches on real historical data to assess their effectiveness.
preview
MQL5 Trading Tools (Part 10): Building a Strategy Tracker System with Visual Levels and Success Metrics

MQL5 Trading Tools (Part 10): Building a Strategy Tracker System with Visual Levels and Success Metrics

In this article, we develop an MQL5 strategy tracker system that detects moving average crossover signals filtered by a long-term MA, simulates or executes trades with configurable TP levels and SL in points, and monitors outcomes like TP/SL hits for performance analysis.
preview
Developing a Trading Strategy: The Triple Sine Mean Reversion Method

Developing a Trading Strategy: The Triple Sine Mean Reversion Method

This article introduces the Triple Sine Mean Reversion Method, a trading strategy built upon a new mathematical indicator — the Triple Sine Oscillator (TSO). The TSO is derived from the sine cube function, which oscillates between –1 and +1, making it suitable for identifying overbought and oversold market conditions. Overall, the study demonstrates how mathematical functions can be transformed into practical trading tools.
preview
Automating Trading Strategies in MQL5 (Part 39): Statistical Mean Reversion with Confidence Intervals and Dashboard

Automating Trading Strategies in MQL5 (Part 39): Statistical Mean Reversion with Confidence Intervals and Dashboard

In this article, we develop an MQL5 Expert Advisor for statistical mean reversion trading, calculating moments like mean, variance, skewness, kurtosis, and Jarque-Bera statistics over a specified period to identify non-normal distributions and generate buy/sell signals based on confidence intervals with adaptive thresholds
preview
How can century-old functions update your trading strategies?

How can century-old functions update your trading strategies?

This article considers the Rademacher and Walsh functions. We will explore ways to apply these functions to financial time series analysis and also consider various applications for them in trading.
preview
Reimagining Classic Strategies (Part 18): Searching For Candlestick Patterns

Reimagining Classic Strategies (Part 18): Searching For Candlestick Patterns

This article helps new community members search for and discover their own candlestick patterns. Describing these patterns can be daunting, as it requires manually searching and creatively identifying improvements. Here, we introduce the engulfing candlestick pattern and show how it can be enhanced for more profitable trading applications.
preview
Formulating Dynamic Multi-Pair EA (Part 5): Scalping vs Swing Trading Approaches

Formulating Dynamic Multi-Pair EA (Part 5): Scalping vs Swing Trading Approaches

This part explores how to design a Dynamic Multi-Pair Expert Advisor capable of adapting between Scalping and Swing Trading modes. It covers the structural and algorithmic differences in signal generation, trade execution, and risk management, allowing the EA to intelligently switch strategies based on market behavior and user input.
preview
Risk-Based Trade Placement EA with On-Chart UI (Part 1): Designing the User Interface

Risk-Based Trade Placement EA with On-Chart UI (Part 1): Designing the User Interface

Learn how to build a clean and professional on-chart control panel in MQL5 for a Risk-Based Trade Placement Expert Advisor. This step-by-step guide explains how to design a functional GUI that allows traders to input trade parameters, calculate lot size, and prepare for automated order placement.
preview
Developing a multi-currency Expert Advisor (Part 22): Starting the transition to hot swapping of settings

Developing a multi-currency Expert Advisor (Part 22): Starting the transition to hot swapping of settings

If we are going to automate periodic optimization, we need to think about auto updates of the settings of the EAs already running on the trading account. This should also allow us to run the EA in the strategy tester and change its settings within a single run.
preview
Neural Networks in Trading: Memory Augmented Context-Aware Learning (MacroHFT) for Cryptocurrency Markets

Neural Networks in Trading: Memory Augmented Context-Aware Learning (MacroHFT) for Cryptocurrency Markets

I invite you to explore the MacroHFT framework, which applies context-aware reinforcement learning and memory to improve high-frequency cryptocurrency trading decisions using macroeconomic data and adaptive agents.
preview
Developing a Trading Strategy: The Butterfly Oscillator Method

Developing a Trading Strategy: The Butterfly Oscillator Method

In this article, we demonstrated how the fascinating mathematical concept of the Butterfly Curve can be transformed into a practical trading tool. We constructed the Butterfly Oscillator and built a foundational trading strategy around it. The strategy effectively combines the oscillator's unique cyclical signals with traditional trend confirmation from moving averages, creating a systematic approach for identifying potential market entries.
preview
Optimizing Long-Term Trades: Engulfing Candles and Liquidity Strategies

Optimizing Long-Term Trades: Engulfing Candles and Liquidity Strategies

This is a high-timeframe-based EA that makes long-term analyses, trading decisions, and executions based on higher-timeframe analyses of W1, D1, and MN. This article will explore in detail an EA that is specifically designed for long-term traders who are patient enough to withstand and hold their positions during tumultuous lower time frame price action without changing their bias frequently until take-profit targets are hit.
preview
Automating Trading Strategies in MQL5 (Part 38): Hidden RSI Divergence Trading with Slope Angle Filters

Automating Trading Strategies in MQL5 (Part 38): Hidden RSI Divergence Trading with Slope Angle Filters

In this article, we build an MQL5 EA that detects hidden RSI divergences via swing points with strength, bar ranges, tolerance, and slope angle filters for price and RSI lines. It executes buy/sell trades on validated signals with fixed lots, SL/TP in pips, and optional trailing stops for risk control.
preview
The MQL5 Standard Library Explorer (Part 3): Expert Standard Deviation Channel

The MQL5 Standard Library Explorer (Part 3): Expert Standard Deviation Channel

In this discussion, we will develop an Expert Advisor using the CTrade and CStdDevChannel classes, while applying several filters to enhance profitability. This stage puts our previous discussion into practical application. Additionally, I’ll introduce another simple approach to help you better understand the MQL5 Standard Library and its underlying codebase. Join the discussion to explore these concepts in action.
preview
Neural Networks in Trading: A Multi-Agent System with Conceptual Reinforcement (Final Part)

Neural Networks in Trading: A Multi-Agent System with Conceptual Reinforcement (Final Part)

We continue to implement the approaches proposed by the authors of the FinCon framework. FinCon is a multi-agent system based on Large Language Models (LLMs). Today, we will implement the necessary modules and conduct comprehensive testing of the model on real historical data.
preview
Self Optimizing Expert Advisors in MQL5 (Part 16): Supervised Linear System Identification

Self Optimizing Expert Advisors in MQL5 (Part 16): Supervised Linear System Identification

Linear system identifcation may be coupled to learn to correct the error in a supervised learning algorithm. This allows us to build applications that depend on statistical modelling techniques without necessarily inheriting the fragility of the model's restrictive assumptions. Classical supervised learning algorithms have many needs that may be supplemented by pairing these models with a feedback controller that can correct the model to keep up with current market conditions.
preview
Neural Networks in Trading: A Multi-Agent System with Conceptual Reinforcement (FinCon)

Neural Networks in Trading: A Multi-Agent System with Conceptual Reinforcement (FinCon)

We invite you to explore the FinCon framework, which is a a Large Language Model (LLM)-based multi-agent system. The framework uses conceptual verbal reinforcement to improve decision making and risk management, enabling effective performance on a variety of financial tasks.
preview
From Novice to Expert: Revealing the Candlestick Shadows (Wicks)

From Novice to Expert: Revealing the Candlestick Shadows (Wicks)

In this discussion, we take a step forward to uncover the underlying price action hidden within candlestick wicks. By integrating a wick visualization feature into the Market Periods Synchronizer, we enhance the tool with greater analytical depth and interactivity. This upgraded system allows traders to visualize higher-timeframe price rejections directly on lower-timeframe charts, revealing detailed structures that were once concealed within the shadows.
preview
Introduction to MQL5 (Part 27): Mastering API and WebRequest Function in MQL5

Introduction to MQL5 (Part 27): Mastering API and WebRequest Function in MQL5

This article introduces how to use the WebRequest() function and APIs in MQL5 to communicate with external platforms. You’ll learn how to create a Telegram bot, obtain chat and group IDs, and send, edit, and delete messages directly from MT5, building a strong foundation for mastering API integration in your future MQL5 projects.
preview
Automating Trading Strategies in MQL5 (Part 37): Regular RSI Divergence Convergence with Visual Indicators

Automating Trading Strategies in MQL5 (Part 37): Regular RSI Divergence Convergence with Visual Indicators

In this article, we build an MQL5 EA that detects regular RSI divergences using swing points with strength, bar limits, and tolerance checks. It executes trades on bullish or bearish signals with fixed lots, SL/TP in pips, and optional trailing stops. Visuals include colored lines on charts and labeled swings for better strategy insights.
preview
Building a Smart Trade Manager in MQL5: Automate Break-Even, Trailing Stop, and Partial Close

Building a Smart Trade Manager in MQL5: Automate Break-Even, Trailing Stop, and Partial Close

Learn how to build a Smart Trade Manager Expert Advisor in MQL5 that automates trade management with break-even, trailing stop, and partial close features. A practical, step-by-step guide for traders who want to save time and improve consistency through automation.
preview
Introduction to MQL5 (Part 26): Building an EA Using Support and Resistance Zones

Introduction to MQL5 (Part 26): Building an EA Using Support and Resistance Zones

This article teaches you how to build an MQL5 Expert Advisor that automatically detects support and resistance zones and executes trades based on them. You’ll learn how to program your EA to identify these key market levels, monitor price reactions, and make trading decisions without manual intervention.
preview
From Novice to Expert: Parameter Control Utility

From Novice to Expert: Parameter Control Utility

Imagine transforming the traditional EA or indicator input properties into a real-time, on-chart control interface. This discussion builds upon our foundational work in the Market Period Synchronizer indicator, marking a significant evolution in how we visualize and manage higher-timeframe (HTF) market structures. Here, we turn that concept into a fully interactive utility—a dashboard that brings dynamic control and enhanced multi-period price action visualization directly onto the chart. Join us as we explore how this innovation reshapes the way traders interact with their tools.
preview
Neural Networks in Trading: A Multimodal, Tool-Augmented Agent for Financial Markets (Final Part)

Neural Networks in Trading: A Multimodal, Tool-Augmented Agent for Financial Markets (Final Part)

We continue to develop the algorithms for FinAgent, a multimodal financial trading agent designed to analyze multimodal market dynamics data and historical trading patterns.
preview
Introduction to MQL5 (Part 25): Building an EA that Trades with Chart Objects (II)

Introduction to MQL5 (Part 25): Building an EA that Trades with Chart Objects (II)

This article explains how to build an Expert Advisor (EA) that interacts with chart objects, particularly trend lines, to identify and trade breakout and reversal opportunities. You will learn how the EA confirms valid signals, manages trade frequency, and maintains consistency with user-selected strategies.
preview
Neural Networks in Trading: A Multimodal, Tool-Augmented Agent for Financial Markets (FinAgent)

Neural Networks in Trading: A Multimodal, Tool-Augmented Agent for Financial Markets (FinAgent)

We invite you to explore FinAgent, a multimodal financial trading agent framework designed to analyze various types of data reflecting market dynamics and historical trading patterns.
preview
Dynamic Swing Architecture: Market Structure Recognition from Swings to Automated Execution

Dynamic Swing Architecture: Market Structure Recognition from Swings to Automated Execution

This article introduces a fully automated MQL5 system designed to identify and trade market swings with precision. Unlike traditional fixed-bar swing indicators, this system adapts dynamically to evolving price structure—detecting swing highs and swing lows in real time to capture directional opportunities as they form.
preview
The MQL5 Standard Library Explorer (Part 2): Connecting Library Components

The MQL5 Standard Library Explorer (Part 2): Connecting Library Components

Today, we take an important step toward helping every developer understand how to read class structures and quickly build Expert Advisors using the MQL5 Standard Library. The library is rich and expandable, yet it can feel like being handed a complex toolkit without a manual. Here we share and discuss an alternative integration routine—a concise, repeatable workflow that shows how to connect classes reliably in real projects.
preview
MQL5 Wizard Techniques you should know (Part 85): Using Patterns of Stochastic-Oscillator and the FrAMA with Beta VAE Inference Learning

MQL5 Wizard Techniques you should know (Part 85): Using Patterns of Stochastic-Oscillator and the FrAMA with Beta VAE Inference Learning

This piece follows up ‘Part-84’, where we introduced the pairing of Stochastic and the Fractal Adaptive Moving Average. We now shift focus to Inference Learning, where we look to see if laggard patterns in the last article could have their fortunes turned around. The Stochastic and FrAMA are a momentum-trend complimentary pairing. For our inference learning, we are revisiting the Beta algorithm of a Variational Auto Encoder. We also, as always, do the implementation of a custom signal class designed for integration with the MQL5 Wizard.
preview
Introduction to MQL5 (Part 24): Building an EA that Trades with Chart Objects

Introduction to MQL5 (Part 24): Building an EA that Trades with Chart Objects

This article teaches you how to create an Expert Advisor that detects support and resistance zones drawn on the chart and executes trades automatically based on them.
preview
Neural Networks in Trading: An Agent with Layered Memory (Final Part)

Neural Networks in Trading: An Agent with Layered Memory (Final Part)

We continue our work on creating the FinMem framework, which uses layered memory approaches that mimic human cognitive processes. This allows the model not only to effectively process complex financial data but also to adapt to new signals, significantly improving the accuracy and effectiveness of investment decisions in dynamically changing markets.
preview
MQL5 Wizard Techniques you should know (Part 84): Using Patterns of Stochastic Oscillator and the FrAMA - Conclusion

MQL5 Wizard Techniques you should know (Part 84): Using Patterns of Stochastic Oscillator and the FrAMA - Conclusion

The Stochastic Oscillator and the Fractal Adaptive Moving Average are an indicator pairing that could be used for their ability to compliment each other within an MQL5 Expert Advisor. We introduced this pairing in the last article, and now look to wrap up by considering its 5 last signal patterns. In exploring this, as always, we use the MQL5 wizard to build and test out their potential.
preview
Self Optimizing Expert Advisors in MQL5 (Part 15): Linear System Identification

Self Optimizing Expert Advisors in MQL5 (Part 15): Linear System Identification

Trading strategies may be challenging to improve because we often don’t fully understand what the strategy is doing wrong. In this discussion, we introduce linear system identification, a branch of control theory. Linear feedback systems can learn from data to identify a system’s errors and guide its behavior toward intended outcomes. While these methods may not provide fully interpretable explanations, they are far more valuable than having no control system at all. Let’s explore linear system identification and observe how it may help us as algorithmic traders to maintain control over our trading applications.
preview
Risk Management (Part 1): Fundamentals for Building a Risk Management Class

Risk Management (Part 1): Fundamentals for Building a Risk Management Class

In this article, we'll cover the basics of risk management in trading and learn how to create your first functions for calculating the appropriate lot size for a trade, as well as a stop-loss. Additionally, we will go into detail about how these features work, explaining each step. Our goal is to provide a clear understanding of how to apply these concepts in automated trading. Finally, we will put everything into practice by creating a simple script with an include file.
preview
MQL5 Wizard Techniques you should know (Part 83):  Using Patterns of Stochastic Oscillator and the FrAMA — Behavioral Archetypes

MQL5 Wizard Techniques you should know (Part 83): Using Patterns of Stochastic Oscillator and the FrAMA — Behavioral Archetypes

The Stochastic Oscillator and the Fractal Adaptive Moving Average are another indicator pairing that could be used for their ability to compliment each other within an MQL5 Expert Advisor. We look at the Stochastic for its ability to pinpoint momentum shifts, while the FrAMA is used to provide confirmation of the prevailing trends. In exploring this indicator pairing, as always, we use the MQL5 wizard to build and test out their potential.
preview
Neural Networks in Trading: An Agent with Layered Memory

Neural Networks in Trading: An Agent with Layered Memory

Layered memory approaches that mimic human cognitive processes enable the processing of complex financial data and adaptation to new signals, thereby improving the effectiveness of investment decisions in dynamic markets.