支持中心 帮助文档 联系我们
📱 微信: 18391752892 | 💬 QQ: 3313198376 | ✈️ Telegram | 📧 fishfx123@gmail.com
EURUSD 1.0856 +0.12% GBPUSD 1.2678 +0.08% USDJPY 149.23 -0.15% XAUUSD 2034.56 +0.34% EURUSD 1.0856 +0.12% GBPUSD 1.2678 +0.08% USDJPY 149.23 -0.15% XAUUSD 2034.56 +0.34%

Scalping MA Cross EA with Trend Filter

👤 作者: Edwin Baktian

4.5 分

¥0.00

📌 版本: v1.1
📥 下载: 0
⭐ 评分: 4.5

📝 产品详情

Scalping MA Cross EA with Trend Filter

作者Edwin Baktian
版本v1.1
更新18 三月 2026
激活数0

? MA Cross 5/10 EA with Trend Filter

This Expert Advisor (EA) is an automated trading system based on a simple and proven Moving Average crossover strategy. It opens trades when a fast Moving Average crosses a slow Moving Average, and uses an optional Trend Filter to avoid trading against the main market direction.

Designed for beginners and intermediate traders, this EA focuses on clarity, stability, and disciplined trading rules.

✅ Main Advantages

✔ Simple and Reliable Strategy
Uses Moving Average crossover logic that is easy to understand and widely used by traders.

✔ Trend Filter for Safer Trading
Optional 200-period Trend Moving Average helps trade only in the direction of the main trend, reducing false signals.

✔ One Trade at a Time
Prevents overtrading by allowing only one active position per symbol and direction.

✔ New Bar Execution
Signals are processed only when a new candle forms, avoiding repeated entries on the same bar.

✔ Automatic Position Management
Automatically closes opposite positions before opening a new one.

✔ Time Filter (Optional)
Allows trading only during selected hours (for example: London or New York sessions).

✔ Fully Customizable
All important parameters can be adjusted to match your trading style and timeframe.

✔ Lightweight and Fast
Uses built-in MT5 indicators without heavy calculations.

⚙️ How It Works

BUY Signal

  • Fast MA crosses above Slow MA

  • (Optional) Price is above Trend MA

  • Time filter allows trading

  • No existing BUY position

SELL Signal

  • Fast MA crosses below Slow MA

  • (Optional) Price is below Trend MA

  • Time filter allows trading

  • No existing SELL position

Only one position is kept at a time. If an opposite signal appears, the EA will close the current position and open a new one.

⭐ Key Features

  • Moving Average crossover strategy (Fast MA & Slow MA)

  • Optional Trend Filter using long-period MA (default 200 EMA)

  • Optional Time Filter for trading sessions

  • Magic Number for trade identification

  • Custom trade comment

  • Works on any symbol and timeframe

  • No repainting logic (uses closed candles)

  • Stable execution on new bar only

  • Clean and well-structured code

? Input Parameters

? Moving Average Settings

  • MA Fast Period – Period of the fast Moving Average (default: 5)

  • MA Slow Period – Period of the slow Moving Average (default: 10)

  • MA Shift – Shift value for Moving Average

  • MA Method – Type of MA (SMA, EMA, SMMA, LWMA)

  • Applied Price – Price used for MA calculation (Close, Open, High, Low, etc.)

? Trend Filter Settings

  • Use Trend Filter – Enable or disable trend filtering (true/false)

  • Trend MA Method – Method of Trend MA (default: EMA)

  • Trend MA Period – Period of Trend MA (default: 200)

  • Trend MA Applied Price – Price type for Trend MA

  • Trend MA Shift – Shift value for Trend MA

? Trade Settings

  • Lot Size – Fixed trading volume per trade

  • Magic Number – Unique ID to identify EA trades

  • Trade Comment – Custom comment for opened trades

⏰ Time Filter Settings (Optional)

  • Use Time Filter – Enable or disable time restriction

  • Start Hour / Start Minute – Trading start time

  • End Hour / End Minute – Trading end time

Supports sessions that cross midnight.

? Recommended Usage

  • Timeframes: M15, M30, H1

  • Symbols: Forex majors, Gold, Indices (with proper lot size)

  • Best used with Trend Filter enabled

  • Combine with proper risk management (lot size adjustment)

⚠️ Important Notes

  • This EA does not use Stop Loss or Take Profit by default (can be modified by user).

  • Always test on Demo Account before using on Real Account.

  • Market conditions may affect performance. Past results do not guarantee future profits.

? Summary

MA Cross 5/10 EA with Trend Filter is a clean, simple, and effective automated trading system that:

  • Trades only on confirmed crossover signals

  • Filters trades by market trend

  • Avoids overtrading

  • Gives full control through input parameters

Perfect for traders who want a basic but disciplined algorithmic trading strategy in MetaTrader 5.


? Setting for Test

Timeframe 15 minutes : https://c.mql5.com/31/1884/Update_Set_-_Backtest_MA_Cross_5-10_and_200_filter.set

XAU/USD

//--- Input parameters

input group "=== Moving Average Settings ==="

input int            InpMAPeriodFast   = 5;           // MA Fast Period

input int            InpMAPeriodSlow   = 10;          // MA Slow Period

input int            InpMAShift        = 1;           // MA Shift

input ENUM_MA_METHOD InpMAMethod       = MODE_SMA;    // MA Method

input ENUM_APPLIED_PRICE InpMAAppliedPrice = PRICE_CLOSE; // Applied Price


input group "=== Trend Filter Settings ==="

input bool           InpUseTrendFilter    = true;         // Use Trend Filter?

input ENUM_MA_METHOD InpTrendMAMethod     = MODE_EMA;     // Trend MA Method

input int            InpTrendMAPeriod     = 200;          // Trend MA Period

input ENUM_APPLIED_PRICE InpTrendMAAppliedPrice = PRICE_CLOSE; // Trend MA Applied Price

input int            InpTrendShift        = 1;            // Trend MA Shift


input group "=== Trade Settings ==="

input double         InpLotSize         = 0.01;         // Lot Size (0 = auto calculate based on risk)

input int            InpMagicNumber     = 202401;       // Magic Number

input string         InpTradeComment    = "MA Cross";   // Trade Comment


input group "=== Risk Management Settings ==="

input bool           InpUseRiskManagement = true;       // Use Risk Management?

input double         InpRiskPercent     = 1.0;          // Risk % per trade (if InpLotSize = 0)

input double         InpMaxRiskPercent  = 5.0;          // Maximum risk % of account

input int            InpStopLossPoints  = 300;          // Stop Loss in points (0 = none)

input int            InpTakeProfitPoints = 600;         // Take Profit in points (0 = none)

input bool           InpUseBreakeven    = false;        // Use Breakeven?

input int            InpBreakevenPoints = 100;          // Points to move to breakeven

input bool           InpUseTrailingStop = false;        // Use Trailing Stop?

input int            InpTrailingStopPoints = 150;       // Trailing Stop points

input double         InpMinFreeMarginPercent = 20;      // Minimum free margin % required


input group "=== Money Management Settings ==="

input bool           InpUseMaxSpread    = true;         // Use maximum spread filter?

input int            InpMaxSpreadPoints = 30;           // Maximum spread in points

input bool           InpUseMaxSlippage  = true;         // Use maximum slippage?

input int            InpMaxSlippagePoints = 10;         // Maximum slippage in points


input group "=== Lot Size Limits ==="

input double         InpMaxLotSize      = 1.0;          // ABSOLUTE MAXIMUM lot size (critical!)

input double         InpMicroLotLimit   = 0.1;          // Maximum lot for small accounts (< $10,000)

input double         InpMiniLotLimit    = 1.0;          // Maximum lot for medium accounts

input double         InpStandardLotLimit = 10.0;        // Maximum lot for large accounts


input group "=== Time Filter Settings (Optional) ==="

input bool           InpUseTimeFilter   = false;        // Use Time Filter?

input int            InpStartHour       = 0;            // Start Hour

input int            InpStartMinute     = 0;            // Start Minute

input int            InpEndHour         = 23;           // End Hour

input int            InpEndMinute       = 59;           // End Minute


input group "=== Backtest Settings ==="

input bool           InpPrintDetailedLog = false;      // Print detailed logs for backtest

input bool           InpUseOptimizationMode = false;   // Optimization mode (minimal logging)

input double         InpMinAccountBalance = 1000;      // Minimum account balance required for trading


安全须知

本产品仅通过 MQL5.com 官方渠道获取。其他渠道版本可能缺少完整功能和技术支持。

EA 配置

交易品种XAUUSD
时间框架H1 (推荐)
推荐经纪商IC Markets, IC Trading
最低存款$300 / 0.01手

📸 截图预览