How to Start with Metatrader 5 - page 148

 

Forum on trading, automated trading systems and testing trading strategies

Buying or Selling all 7 pairs

Sergey Golubev, 2026.04.08 16:21

Developing a Multi-Currency Expert Advisor (Part 26): Informer for Trading Instruments

Developing a Multi-Currency Expert Advisor (Part 26): Informer for Trading Instruments

For almost the entire series, we worked with only one simple trading strategy, and only in the last parts, when the main features had already been implemented, we started considering adding a new trading strategy and using it as the main one. This example demonstrated the possibility of trying to unlock the potential of almost any trading strategy (if that potential really exists, of course).


 

Publish Your Article Code to MQL5 Algo Forge in 10 Minutes: A Step-by-Step Guide

Publish Your Article Code to MQL5 Algo Forge in 10 Minutes: A Step-by-Step Guide

Is your article already published in MQL5? Then take the next step: turn the code from the article into a full-fledged project in MQL5 Algo Forge. Do not leave the source files only in an archive. Move them to the repository so that readers see the current version of the project, a clear file structure, a change history, and a clear description. Algo Forge is based on Git, but the main Git actions are already built into the MetaEditor interface, and README.md becomes the face of the project.
 

Forum on trading, automated trading systems and testing trading strategies

Multi instrument robot

Sergey Golubev, 2026.06.08 14:52

Developing a Multi-Currency Expert Advisor (Part 28): Adding a Position Closing Manager

Developing a Multi-Currency Expert Advisor (Part 28): Adding a Position Closing Manager

In Part 12, we added a risk manager module to the multi-currency EA to limit daily and overall drawdown. It does not increase profits, but is critical to protecting funds in adverse conditions. It is based on prop trading rules with flexible settings: drawdown in currency, as a percentage of the balance, or from the start of the day.

The module is implemented as the CVirtualRiskManager class with methods for tracking balance, profit, and checking limitations. A profit-locking function is also provided: once the target is reached, all positions are closed and trading stops.

 

Forum on trading, automated trading systems and testing trading strategies

MetaTrader 5 Beta Build 5955: MCP and Agentic AI support

MetaQuotes, 2026.06.26 15:44

We're introducing a new beta version of MetaTrader 5 with built-in support for the Model Context Protocol (MCP) and agentic AI. These new capabilities are now available in both the client terminal and MetaEditor, and we invite all users to participate in the public beta.


How to Get the New Version

To update to the AI-enabled beta, connect to the MetaQuotes-Demo server: use an existing demo account or create a new one. If the server is not listed in your platform, enter access.metatrader5.com in the account opening dialog and click 'Find your company'.

Open a demo account on the MetaQuotes-Demo server to get the AI-enabled beta


What Is MCP?

The Model Context Protocol (MCP) is an open standard that enables applications to communicate with AI agents. Unlike traditional chatbots, AI agents can independently complete complex tasks by breaking them down into a sequence of actions and using the capabilities of connected applications.

With built-in MCP support, MetaTrader 5 becomes a fully featured source of market data and trading functionality for modern AI agents. They can access market information, analyze charts, work with the trading environment, and perform required operations through the standard MCP interface.

In addition to the built-in AI assistant, you can also connect external systems that support MCP, including OpenAI Codex, Claude Code, and other compatible solutions.


No Configuration Required

To start using AI features, simply sign in to your MQL5.community account. After updating, the platform automatically configures everything you need: MQL5.community is selected as the default AI provider, and the required API key is added automatically.

If you prefer, you can use your own API keys for OpenAI, Anthropic, Gemini, DeepSeek, Ollama, or other supported providers, and select your preferred model directly in the terminal settings.

AI Settings

Your AI settings are automatically synchronized between the trading terminal and MetaEditor.


AI Assistant in MetaTrader 5

The built-in AI Assistant helps you analyze markets. It can explain current market conditions for a symbol, review your open positions, analyze your trading history, answer questions about financial instruments, and provide context on recent market events.

Ask AI to analyze your trading

Example prompts:

  • Analyze the current EURUSD situation on the H1 timeframe. Identify the trend, the nearest support and resistance levels, and explain what's happening in the market.
  • Analyze my open positions. Which trades currently carry the highest risk, and why?
  • Analyze my trading history for the last three months. Identify my most profitable trades and suggest ways to improve my trading strategy.
  • Scan all symbols in Market Watch and identify those where an important level breakout or a strong trend is currently developing.

Important: AI-generated responses are provided for informational purposes only and do not constitute investment advice. Use them as an additional analytical tool and always make trading decisions based on your own judgment.


AI Assistant in MetaEditor

The AI Assistant in MetaEditor is now a full-featured development assistant. It can:

  • Generate new MQL5 programs
  • Analyze existing code
  • Detect errors and suggest fixes
  • Explain complex algorithms
  • Explain complex algorithms

Launch the assistant from the File menu, the toolbar, or the Navigator context menu. Then simply describe your task in natural language.

Ask AI to write a script for you

Example prompts:

  • Create an Expert Advisor that opens a position when the EMA 20 crosses the EMA 50, uses a 500-point Stop Loss, a 1000-point Take Profit, and risks 1% of the account deposit.
  • Analyze this MQL5 code, identify potential issues, explain their causes, and provide a corrected version.
  • Optimize this indicator to reduce calculations and improve performance without changing its logic.
  • Convert this MQL4 Expert Advisor to MQL5 using modern language features and the Standard Library.
  • Explain how this Expert Advisor works. Describe its trading logic, the indicators it uses, its entry and exit conditions, and any potential weaknesses in the strategy.

The more detailed your request, the more accurate and useful the generated results will be.

Your conversation history is available in the Chats tab of the Navigator.


Join the Beta Testing

The integration of MCP and agentic AI introduces an entirely new way to interact with the trading platform. We will continue to expand these capabilities and invite traders and MQL5 developers to help us test them.

Try the new features, share your feedback, and help us make AI-powered tools in MetaTrader 5 even more capable, intuitive, and effective.


 

This is very interesting:

No Configuration Required

To start using AI features, simply sign in to your MQL5.community account. After updating, the platform automatically configures everything you need: MQL5.community is selected as the default AI provider, and the required API key is added automatically.

 

Forum on trading, automated trading systems and testing trading strategies

MetaEditor, Open AI and ChatGPT

Sergey Golubev, 2026.07.01 15:31

Code, Tears, and Algo Forge

Code, Tears, and Algo Forge

Switching to Algo Forge isn't just a change in how you store files; it's a new standard for professional activities. We're moving away from static ZIP archives and lengthy republishing cycles to living, relevant projects that are under your complete control, right here and now.

For you, as an author, this means, first and foremost, saving time and keeping things in order. There's no longer any need to search for old archives on the drive or explain to readers repeatedly how to manually assemble a project. Now your work lives in the cloud, and any correction can be added to the repository instantly—with a single command from MetaEditor. No unnecessary emails, no waiting for moderation, and no edits to the text of the article itself.

Incorporating such tools into your practice isn't just about following trends, but a way to make your article production more predictable and high-quality. Ultimately, when an author chooses a modern approach to code presentation, it inevitably raises the bar for quality content throughout the entire resource. This is a case where technology helps us focus on what matters most, turning each article into a fully-fledged and long-lasting working tool for the entire community.