This is an automated trading bot (Expert Advisor) designed for MetaTrader 5 (MT5), optimized for the EUR/USD currency pair. It follows a strategy based on market movement, stop-loss adjustments, and trailing stops to manage risk and maximize profit.
🚀 Key Features:
- Fully automated trading with risk management
- Optimized for EUR/USD
- Supports trailing stop and dynamic TP/SL calculations
- Configurable speed classification thresholds
- Includes debugging mode for testing
- Open MetaTrader 5.
- Navigate to File → Open Data Folder.
- Go to MQL5 → Experts.
- Copy the EA file (
YourBotName.ex5) into the Experts folder. - Restart MetaTrader 5 or refresh the Navigator panel.
- Open the EUR/USD chart.
- Choose the recommended timeframe (H1 or as per
SESSION_PERIOD_RESOLUTION). - Drag and drop the EA onto the chart from the Navigator panel.
- In the Inputs/Parameters tab, adjust settings as needed:
- Lot Size: Default
0.01, adjust based on account balance. - Stop-Loss & Take-Profit: Default
500 points, can be dynamically calculated. - Trailing Stop: Enabled by default, starts trailing after
50 pips. - Speed Threshold Classification: Disabled by default but can be enabled for momentum-based trading.
- Lot Size: Default
- Click OK to start the bot.
- Ensure AutoTrading is enabled (✅ button on MT5).
| Parameter | Description | Default Value |
|---|---|---|
InpFastPeriod |
Fast-moving average period | 14 |
InpSlowPeriod |
Slow-moving average period | 21 |
lotSize |
Lot size per trade | 0.01 |
InpStopLoss |
Stop loss in points | 500 |
InpTakeProfit |
Take profit in points | 500 |
InpStopLossAdjustment |
SL Adjustment factor | 0.0001 |
InpTakeProfitAdjustment |
TP Adjustment factor | 0.0001 |
InpMagicNumber |
Unique identifier for trades | 820607 |
InpNumberOfCandlesTrailingSL |
Candles to use for trailing stop | 10 |
UseTrailing |
Enable trailing stop | true |
WhenToTrail |
Start trailing after X pips | 50 |
TrailBy |
Trail stop distance in pips | 20 |
CalculateDynamicTP_SL |
Enable dynamic TP/SL calculations | false |
FactorVolatilityIn_TP_SL_Calculation |
Factor volatility into TP/SL | false |
MaxOpenTradesPerSession |
Max open trades per session | 1 |
SESSION_PERIOD_RESOLUTION |
Timeframe for session period | H1 |
BEBUG_BOT |
Enable debug mode | true |
fastThreshold |
Speed classification (fast) | 0.00110 |
slowThreshold |
Speed classification (slow) | 0.00011 |
EnableSpeedThreshold |
Enable speed threshold for trades | false |
To optimize the bot:
- Open Strategy Tester (
Ctrl + R). - Select YourBotName.ex5 from the Expert Advisor list.
- Choose EUR/USD as the trading pair.
- Set H1 as the timeframe.
- Run a backtest and analyze the results.
- 🧪 Backtesting Recommended: Run backtests on EUR/USD before live trading.
- ⚡ VPS Recommended: For 24/7 operation, use a VPS to prevent downtime.
- 📈 Risk Management: Adjust lot size, stop-loss, and trailing stops based on account balance.
For any questions, bug reports, or feature requests, feel free to reach out!
📧 Email: your-email@example.com
🌐 Website: your-website.com
Happy Trading! 🚀📈