# MT5 Multi Regime & ML Forex Trading Bot

> A production-structured MetaTrader 5 trading framework with ML regime filtering and automated risk management.

MT5 Multi Regime & ML Forex Trading Bot is a paid AI agent skill on Agensi by Sini Salu, in Trading & Investing. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $100 (one-time purchase)
- Creator: [Sini Salu](https://www.agensi.io/creators/sini-salu)
- Category: [Trading & Investing](https://www.agensi.io/skills/trading-investing)
- Version: 1.0
- Last updated: 2026-11-23
- Security: scan passed (2026-11-23); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/mt5-multi-regime-ml-forex-trading-bot
- Tags: trading, automation, web3

## About this skill

Setting up an automated trading system often results in fragmented scripts and loose risk controls that lead to account blowouts. This skill provides a production-ready Python framework for MetaTrader 5 that integrates price action, technical indicators, and machine learning into a unified execution engine.

### What it does
- **ML Regime Filtering** uses offline training to classify market environments and filter out low-probability signals.
- **Price Action Detection** scans for multi-candle patterns and market structure shifts in real-time.
- **Automated MT5 Execution** handles the complete lifecycle of authentication, data polling, and order routing.
- **Strict Risk Management** enforces position sizing, trailing stop-losses, and hard caps on daily drawdown.
- **Audit Logging** records every signal score and execution detail for post-trade performance analysis.

### How it works
1. **Initialize Environment**: Install dependencies and verify the Windows-based MT5 terminal connection.
2. **Configure Security**: Set account credentials via environment variables to keep sensitive data out of `config.py`.
3. **Calibrate Models**: Run the offline training script to generate weights for specific currency pairs.
4. **Deploy Bot**: Launch the primary execution loop to monitor watchlists and manage active positions.

### Frameworks & tools
This system is built with Python 3.10+ and the MetaTrader5 library. It requires a Windows environment to interface with the MT5 Desktop Terminal.

### Why this beats prompting it yourself
Building a reliable trading loop requires complex state management and error handling for broker connections. This skill provides a pre-structured architecture where risk management and signal logic are decoupled, preventing the common bugs found in monolithic AI-generated scripts.

### Use cases
- Deploy a trend-following bot on a MetaTrader 5 demo account for forward testing.
- Backtest and train a machine learning model on historical OHLCV data.
- Automate position sizing based on a fixed percentage of current account equity.
- Audit existing trading logs to correlate ML signal scores with actual PnL.

### Known limitations
Requires Windows OS for the MetaTrader5 Python package. Users must manually install and log into the MT5 Desktop Terminal before execution.

## Requires

- Python

Install Python dependencies via pip install -r requirements.txt and ensure "Algo Trading" is enabled in your MetaTrader 5 terminal toolbar before running main_bot.py. Always test on a Demo account first.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the MT5 Multi Regime & ML Forex Trading Bot skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What specific problems does this MT5 framework solve for algorithmic traders?

This skill provides a production-ready Python framework that bridges machine learning with MT5. It solves the issue of inconsistent execution by decoupling signal logic from risk management, ensuring that every trade is filtered through ML regime detection and strict drawdown controls.

### What are the system requirements and agent compatibility for this skill?

The framework is built for Python 3.10+ and requires a Windows environment to interface with the MetaTrader 5 Desktop Terminal. It is designed to work as a standalone execution engine or can be integrated into broader AI-driven trading workflows that support Python script execution.

### What exactly is included in the purchase of this skill?

You will receive the complete modular Python architecture, including the core execution engine, ML training scripts, risk management modules, and a template for environment-based security configuration. Documentation for installation and model calibration is also included.

### Do I need a specific broker to use the Multi Regime & ML Trading Bot?

No, this skill is designed to be broker-agnostic. As long as your broker supports the MetaTrader 5 Desktop Terminal and provides a Python API connection, you can use this framework to automate your trading.

### How does the framework handle sensitive broker credentials and account security?

The framework uses a 'Security-First' approach where account credentials and API keys are stored in environment variables. This prevents sensitive information from being hardcoded in your configuration files, protecting your account even if you share your script structure.

### Can I customize the trading signals and ML models within the framework?

Yes, the skill is designed for modularity. While it comes with pre-configured price action and technical indicators, the architecture allows you to plug in your own logic or adjust the ML training parameters to suit different currency pairs and trading styles.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
