Skip to content

NziCode/mt5-trading-bots

Repository files navigation

🤖 MT5 Automated Trading Bots

Automated Expert Advisors (EAs) for MetaTrader 5 — each with an independent strategy per instrument.

⚠️ Disclaimer: These bots are in active testing on a demo account. No strategy guarantees profit. Trade only with capital you can afford to lose.


📦 Bots Overview

Version 2 (Current)

Bot Symbol Timeframe Strategy Lot
Gold_ATR_Breakout_v2 XAUUSD M15 ATR Breakout + EMA Trend 0.1
Bitcoin_BollingerReversion_v2 BTCUSD M15 Bollinger Mean Reversion + RSI 0.1
EURUSD_PriceAction_Stoch_v2 EURUSD M15 Swing Price Action + Stochastic 0.1
Nasdaq_ORB_Momentum_v2 NDXUSD M15 Opening Range Breakout 0.1

Version 1 (Archived)

Bot Symbol Timeframe Lot
Gold_ATR_Breakout XAUUSD M5 0.01
Bitcoin_BollingerReversion BTCUSD M5 0.01
EURUSD_PriceAction_Stoch EURUSD M5 0.01
Nasdaq_ORB_Momentum US100 M5 0.01

🆕 V2 Improvements

All v2 bots include:

  • Multi-TP system — TP1 (40% close → breakeven), TP2 (30% close), TP3 (30% remaining)
  • Risk-free after TP1 — SL moves to breakeven automatically
  • Trailing stop — activates after TP1, follows price with configurable step
  • M15 timeframe — more signals vs H1/M5 with better noise filtering
  • News filter — optional, blocks new entries 30 min before/after high-impact events (via Flask bridge)
  • Relaxed entry conditions — Gold ATR multiplier lowered, BTC RSI threshold widened, Nasdaq ORB window reduced to 15 min

📊 Strategy Details

🥇 Gold_ATR_Breakout_v2 — XAUUSD

  • Indicators: ATR(14) + EMA(21) + EMA(89)
  • Entry: Breakout above/below recent 20-bar high/low with ATR volatility confirmation
  • SL: 1× ATR | TP1: 1.5× | TP2: 2.5× | TP3: 3.5×
  • Trailing: 1.2× ATR from TP1

₿ Bitcoin_BollingerReversion_v2 — BTCUSD

  • Indicators: BB(20, 2.0) + RSI(14) + EMA(100)
  • Entry: Price at band extreme + RSI 35/65 + EMA trend direction
  • SL: 0.8% | TP1: 1.0% | TP2: 1.8% | TP3: 2.8%
  • Trailing: 0.8% from TP1

💶 EURUSD_PriceAction_Stoch_v2 — EURUSD

  • Indicators: Stochastic(5,3,3) + EMA(21) + EMA(50) + EMA(200)
  • Entry: Swing high/low + Stochastic crossover at 20/80 + triple EMA alignment
  • SL: 15 pip | TP1: 20 pip | TP2: 35 pip | TP3: 55 pip
  • Trailing: 10 pip step from TP1

📈 Nasdaq_ORB_Momentum_v2 — NDXUSD

  • Entry: 15-min opening range breakout (NY open 14:30–20:00 UTC)
  • SL: 0.4% | TP1: 0.5% | TP2: 0.9% | TP3: 1.4%
  • Trailing: 0.4% from TP1
  • Max 2 trades/day

📈 Performance Log

Week 1 — June 29 to July 4, 2026 (V1, Demo)

Account: AronMarkets-Demo | Starting Balance: $10,000.00

Metric Value
Ending Balance $10,008.07
Realized Profit +$8.07
Floating P&L +$1.54
Total Net +$9.61
Total Trades 18
Win Rate ~67%
Return +0.096%

Per-bot activity:

Bot Trades Status
EURUSD_PriceAction_Stoch 18 ✅ Active
Nasdaq_ORB_Momentum 2 open ✅ Active
Gold_ATR_Breakout 0 ❌ No signal
Bitcoin_BollingerReversion 0 ❌ No signal

Notes:

  • Gold and BTC had no valid entry conditions — ATR threshold too strict, RSI range too narrow
  • EURUSD traded on H1; signals were infrequent and some entries had poor timing
  • Lot size 0.01 kept losses minimal but profits very small
  • V2 deployed with relaxed thresholds, M15 timeframe, and lot size 0.1

How to update this log: After each week, add a new section below with the same table structure. Include date range, starting/ending balance, trade count, win rate, and per-bot notes.


Week 2 — [Date Range] (V2, Demo)

(To be filled after one week of V2 operation)


🛠️ Installation

Prerequisites

  • MetaTrader 5
  • Demo or live account with a supported broker (tested on Aron Markets)

Steps

1. Copy EA files

[MT5 Data Folder] → MQL5 → Experts

Find data folder: File → Open Data Folder

2. Compile

  • Navigator → Expert Advisors → Refresh
  • Double-click file → MetaEditor → F7
  • Confirm: 0 errors, 0 warnings

3. Enable WebRequest (only if using Telegram/news filter)

Tools → Options → Expert Advisors
✅ Allow WebRequest for listed URL
URL: http://127.0.0.1:5000

4. Attach to Chart

  • Open chart for the symbol on M15
  • Drag EA from Navigator onto chart
  • Common tab → Allow Algo Trading ✅

⚙️ Key Parameters (V2)

Parameter Gold BTC EURUSD Nasdaq
LotSize 0.1 0.1 0.1 0.1
MaxTradesPerDay 2 3 3 2
MaxDailyLoss ($) 50 80 30 100
CooldownBars 4 5 3

🔒 Risk Management

All bots include:

  • ✅ Daily loss limit
  • ✅ Max trades per day
  • ✅ Cooldown bars between trades
  • ✅ Automatic SL & TP on every trade
  • ✅ Multi-TP with partial closes (V2)
  • ✅ Risk-free (breakeven) after TP1 (V2)
  • ✅ Trailing stop after TP1 (V2)

📡 Telegram Reporting (Optional)

cd python
pip install -r requirements.txt
cp config/.env.example config/.env
# Fill in TELEGRAM_TOKEN and CHAT_ID
python main.py

📁 Project Structure

mt5-trading-bots/
├── gold/
│   ├── Gold_ATR_Breakout.mq5           # v1
│   └── Gold_ATR_Breakout_v2.mq5        # v2 (current)
├── bitcoin/
│   ├── Bitcoin_BollingerReversion.mq5  # v1
│   └── Bitcoin_BollingerReversion_v2.mq5
├── eurusd/
│   ├── EURUSD_PriceAction_Stoch.mq5    # v1
│   └── EURUSD_PriceAction_Stoch_v2.mq5
├── nasdaq/
│   ├── Nasdaq_ORB_Momentum.mq5         # v1
│   └── Nasdaq_ORB_Momentum_v2.mq5
└── python/
    ├── main.py
    ├── config.py
    ├── messages.py
    └── requirements.txt

⚠️ Risk Disclaimer

Developed for educational and research purposes. Trading carries significant risk. Past performance is not indicative of future results. The author accepts no liability for financial losses.

Never risk more than you can afford to lose.


🤝 Contributing

Active testing phase. Issues and PRs welcome.

📜 License

MIT License

About

Automated trading bots for MetaTrader 5 — Gold, Bitcoin, EURUSD & Nasdaq with independent strategies

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages