FxMath Momentum EA
Professional algorithmic trading bot powered by MACD and RSI momentum strategies. Built for MetaTrader 5 with advanced risk management and pyramiding capabilities.
✨ Key Features
MACD + RSI Strategy
Proven momentum-based strategy combining MACD crossovers with RSI confirmation for high-probability entries.
Pyramiding Support
Stack multiple positions during strong trends (up to 10 concurrent positions) for maximum profit potential.
Advanced Risk Management
ATR-based stop loss, customizable risk:reward ratios, and daily profit/loss limits to protect your capital.
MQ5 Bug Mode
Replicate the profitable behavior of the original MQ5 EA with aggressive trading settings.
Modern GUI
Beautiful CustomTkinter interface with real-time monitoring, performance metrics, and easy configuration.
Fully Customizable
Fine-tune every parameter from indicator settings to risk management rules to match your trading style.
🚀 Quick Start Guide
Get up and running in 5 minutes:
Option 1: Standalone Executable (Recommended)
📦 Download FxMath_Momentum_EA.exe
# 1. Download the executable from the link above
# 2. Double-click to run
# 3. Configure your MT5 connection
# 4. Click "Start Bot" ✅
Option 2: From Source
# 1. Install dependencies
pip install -r requirements.txt
# 2. Run the application
python main.py
# 3. Configure and start trading!
📖 Introduction
FxMath Momentum EA is a sophisticated algorithmic trading system designed for MetaTrader 5. It combines the power of MACD (Moving Average Convergence Divergence) and RSI (Relative Strength Index) indicators to identify high-probability momentum trades.
What Makes It Special?
- Proven Strategy: Based on well-established technical indicators used by professional traders
- Pyramiding: Ability to stack multiple positions during strong trends for exponential gains
- Risk Control: Multiple layers of protection including ATR-based stops and daily limits
- MQ5 Bug Mode: Replicates the profitable behavior of the original MQ5 EA
- User-Friendly: Modern GUI makes configuration and monitoring effortless
💾 Installation
System Requirements
| Component | Requirement |
|---|---|
| Operating System | Windows 10/11 (64-bit) |
| MetaTrader 5 | Latest version |
| Python (source only) | 3.8 or higher |
| RAM | 4GB minimum, 8GB recommended |
| Disk Space | 100MB |
Step-by-Step Installation
1. Install MetaTrader 5
Download and install MT5 from your broker's website. Make sure to:
- Enable "Algo Trading" in MT5 settings (Tools → Options → Expert Advisors)
- Allow DLL imports
- Connect to your trading account
2. Install Python Dependencies (if running from source)
pip install MetaTrader5 customtkinter
3. Configure MT5 Connection
The EA will automatically detect your MT5 installation. If you have multiple terminals:
- Go to the "🔧 Filters" tab
- Select your preferred MT5 terminal from the dropdown
4. First Run
Launch the EA and configure your initial settings:
- Symbol: Choose your trading pair (e.g., EURUSD, XAUUSD)
- Timeframe: Select chart timeframe (M5 recommended)
- Risk: Set your risk percentage per trade (1% recommended)
📊 Trading Strategy
Core Methodology
The FxMath Momentum EA uses a dual-indicator approach to identify momentum-based trading opportunities:
Entry Signals
BUY Signal:
- MACD line crosses above the signal line (bullish crossover)
- AND RSI is above the threshold (default: 50)
SELL Signal:
- MACD line crosses below the signal line (bearish crossover)
- AND RSI is below the inverse threshold (default: 50)
Exit Strategy
Positions can be closed by:
- Take Profit: Automatically set at Risk:Reward ratio (default: 2.5:1)
- Stop Loss: ATR-based dynamic stop (default: 2.0 × ATR)
- Momentum Reversal: Optional early exit when MACD crosses opposite direction
- Cut Profit/Loss: Daily cumulative limits
Pyramiding (Multiple Positions)
When MQ5 Bug Mode is enabled, the EA can open multiple positions in the same direction:
- Maximum 10 concurrent positions (configurable)
- One position per candle maximum
- All positions in the same direction (all BUY or all SELL)
- Ideal for capturing strong trending moves
⚡ MQ5 Bug Mode
This special mode replicates the behavior of the original MQ5 EA, which had a "bug" that turned out to be highly profitable.
What is MQ5 Bug Mode?
The original MQ5 EA had unintended behavior that allowed:
- No SL/TP: Positions opened without stop loss or take profit
- Multiple Entries: Multiple positions per bar during strong momentum
- No Reversal Close: Positions kept open even when momentum reverses
How to Enable
MQ5 Bug Mode is enabled by default in v1.02. To customize:
- Go to the 💰 Risk tab
- Check/uncheck the aggressive mode options:
- ✅ Allow positions WITHOUT SL/TP
- ✅ Allow multiple entries per bar
- Go to 🔧 Filters tab
- Set "Max Concurrent Positions" to 10 (default)
Or simply click the 🚀 MQ5 BUG MODE quick preset button in the Controls tab!
Performance Characteristics
| Metric | Conservative Mode | MQ5 Bug Mode |
|---|---|---|
| Max Positions | 1 | 10 |
| Stop Loss | Always set | Optional |
| Profit Potential | Moderate | Very High |
| Risk Level | Low-Medium | Very High |
| Recommended For | Beginners | Experienced traders |
🛡️ Risk Management
Position Sizing
The EA offers two lot sizing modes:
1. Risk-Based (Recommended)
Automatically calculates lot size based on:
- Account balance
- Risk percentage per trade (default: 1%)
- Stop loss distance in pips
Lot Size = (Account Balance × Risk%) / (Stop Loss Pips × Pip Value)
2. Fixed Lot
Use a fixed lot size for all trades (e.g., 0.01, 0.1, 1.0)
Stop Loss & Take Profit
Dynamic stops based on ATR (Average True Range):
- Stop Loss: 2.0 × ATR (default) - adapts to market volatility
- Take Profit: SL distance × Risk:Reward ratio (default: 2.5:1)
Daily Limits
Protect your account with daily profit/loss limits:
- Cut Profit: Stop trading after reaching daily profit target (default: $100)
- Cut Loss: Stop trading after reaching daily loss limit (default: $100)
⚙️ Settings Reference
Indicator Settings
| Parameter | Default | Range | Description |
|---|---|---|---|
| MACD Fast | 16 | 5-50 | Fast EMA period |
| MACD Slow | 26 | 10-100 | Slow EMA period |
| MACD Signal | 11 | 5-50 | Signal line period |
| RSI Period | 14 | 2-100 | RSI calculation period |
| RSI Threshold | 50 | 0-100 | Entry confirmation level |
| ATR Period | 14 | 2-100 | Volatility measurement |
Risk Settings
| Parameter | Default | Description |
|---|---|---|
| Stop Loss (ATR) | 2.0 | SL distance in ATR multiples |
| Risk:Reward | 2.5:1 | TP/SL ratio |
| Risk % | 1.0% | Account risk per trade |
| Max Positions | 10 | Concurrent position limit |
| Cut Profit | $100 | Daily profit target |
| Cut Loss | $100 | Daily loss limit |
📈 Indicators Explained
MACD (Moving Average Convergence Divergence)
MACD measures momentum by comparing two exponential moving averages:
- MACD Line: Fast EMA (16) - Slow EMA (26)
- Signal Line: 11-period EMA of MACD line
- Crossovers: Generate buy/sell signals
RSI (Relative Strength Index)
RSI measures the speed and magnitude of price changes:
- Range: 0-100
- Above 50: Bullish momentum (BUY confirmation)
- Below 50: Bearish momentum (SELL confirmation)
ATR (Average True Range)
ATR measures market volatility:
- Used to set dynamic stop loss distances
- Adapts to changing market conditions
- Higher ATR = wider stops (volatile markets)
- Lower ATR = tighter stops (calm markets)
❓ Frequently Asked Questions
What is the minimum deposit required?
We recommend a minimum of $500 for conservative trading (1% risk per trade). For MQ5 Bug Mode with pyramiding, $1000+ is recommended to handle multiple concurrent positions safely.
Which currency pairs work best?
The EA works best on trending pairs with good liquidity:
- Excellent: XAUUSD (Gold), EURUSD, GBPUSD
- Good: USDJPY, AUDUSD, USDCAD
- Avoid: Exotic pairs with high spreads
What timeframe should I use?
M5 (5-minute) is the recommended default. However, the EA works on any timeframe:
- M1-M5: More signals, higher frequency (scalping)
- M15-H1: Balanced approach (swing trading)
- H4-D1: Fewer but higher quality signals (position trading)
Can I run the EA on multiple pairs simultaneously?
Currently, each instance of the EA monitors one symbol. To trade multiple pairs, you can run multiple instances of the EA with different configurations. Make sure to adjust your risk accordingly!
Is MQ5 Bug Mode safe?
No, it is high risk. MQ5 Bug Mode can be very profitable but also very dangerous. It allows positions without stop losses and multiple concurrent positions. Only use it if:
- You have experience with aggressive trading strategies
- You can afford to lose your entire trading capital
- You actively monitor the EA and can intervene if needed
- You use strict daily loss limits
Does the EA work on demo accounts?
Yes! We strongly recommend testing on a demo account first. Run the EA for at least 1-2 weeks on demo to understand its behavior before risking real money.
🔧 Troubleshooting
EA Won't Connect to MT5
Solution:
- Make sure MT5 is running and logged in
- Check that "Algo Trading" is enabled in MT5 (Tools → Options → Expert Advisors)
- If you have multiple MT5 terminals, select the correct one in the EA settings
- Try restarting both MT5 and the EA
No Trades Being Opened
Possible causes:
- No signals: Market conditions may not meet entry criteria. Be patient!
- Daily limits reached: Check if cut profit/loss limits were triggered
- Time filter: Verify time filter settings aren't blocking trades
- Max positions: Check if max concurrent positions limit is reached
Positions Not Pyramiding
Check these settings:
- ✅ "Allow multiple entries per bar" is enabled (💰 Risk tab)
- ✅ "Max Concurrent Positions" is set to 10 (🔧 Filters tab)
- ✅ You haven't already reached the max position limit
- ✅ There's a new candle (only one position per candle allowed)
High Slippage or Order Rejections
Solutions:
- Increase "Max Slippage" setting (default: 30 points)
- Trade during high liquidity hours (avoid news events)
- Use a broker with good execution quality
- Reduce lot size if your account is too small
📝 Changelog
Version 1.02 (2026-02-06)
- ✅ Multiple Position Support: Now properly pyramids up to 10 concurrent positions
- ✅ Improved Position Management: Each position tracked individually with ticket numbers
- ✅ Enhanced Exit Logic: Closes all positions on momentum reversal (if enabled)
- ✅ Better Logging: More detailed position tracking and pyramiding notifications
- Fixed default max_open_trades (now 10 instead of 1)
- Fixed position counting logic to properly support pyramiding
- Fixed main loop to always check for entry signals when not at max positions
Version 1.01 (2026-02-04)
- Rebranded from "FX Momentum Bot" to "FxMath Momentum EA"
- MQ5 Bug Mode enabled by default
- Improved GUI with tabbed interface
- Added quick preset buttons
Version 1.0 (2026-02-01)
- MACD + RSI momentum strategy
- ATR-based risk management
- CustomTkinter GUI
- Real-time monitoring dashboard
- Cut profit/loss functionality