Dual MA Cross with Filter
- Experten
- Fabio Mazzotta
- Version: 1.5
- Aktualisiert: 22 November 2024
- Aktivierungen: 5
Automatic Trading with Moving Averages and Trend Filtering
The "Dual MA Cross with Filter" Expert Advisor (EA) is a Forex trading system designed to provide flexibility and precision. It allows you to customize several input parameters to adapt its behavior to your trading strategy. The EA has been functionality-tested on the EURUSD currency pair with a 5 minutes timeframe, but it can be used on other Forex pairs. It is strongly recommended to verify its functionality and performance through backtesting before applying it to other pairs or timeframes. Additionally, users should implement their own money management strategy, as this EA does not include built-in risk management beyond trade sizing and stop loss settings.
Customizable Input Parameters:
-
Lot Size ( LotSize ):
- Specify the trading volume for each trade. The EA will automatically adjust this value to conform to your broker’s rules regarding minimum lot size, maximum lot size, and lot step increments.
- Default: 0.1 lots.
-
Filter Moving Average Settings:
- Period: Set the period of the moving average used as a trend filter.
- Method: Choose the type of moving average calculation (e.g., SMA, EMA).
- Timeframe: Use the current chart timeframe or specify a different one.
- Default: Period = 50, Method = SMA, Timeframe = Current Chart (PERIOD_CURRENT).
-
Slow Moving Average Settings:
- Period: Set the period of the slower moving average.
- Method: Choose the type of moving average calculation (e.g., SMA, EMA).
- Timeframe: Use the current chart timeframe or specify a different one.
- Default: Period = 26, Method = SMA, Timeframe = Current Chart (PERIOD_CURRENT).
-
Fast Moving Average Settings:
- Period: Set the period of the faster moving average.
- Method: Choose the type of moving average calculation (e.g., SMA, EMA).
- Timeframe: Use the current chart timeframe or specify a different one.
- Default: Period = 7, Method = SMA, Timeframe = Current Chart (PERIOD_CURRENT).
-
Risk and Reward Settings:
- Take Profit (TP): Specify the profit target in pips.
- Stop Loss (SL): Specify the loss limit in pips.
- Default: TP = 50 pips, SL = 50 pips.
-
Trading Behavior:
- Enable_Trading: Toggle automatic trade execution. Set to False to use the EA solely as a signal generator.
- Send_Alerts: Enable or disable alerts when signals are generated.
- Default: Enable_Trading = True , Send_Alerts = True .
How the EA Works:
-
Three Moving Averages:
- Filter Moving Average: Serves as a trend filter to determine the overall market direction.
- Slow and Fast MAs: Generate trading signals when they cross each other relative to the Filter MA.
-
Trade Logic:
- Buy Signal:
- The Fast MA crosses above the Slow MA.
- Both the Fast and Slow MAs are above the Filter MA, indicating an uptrend.
- Sell Signal:
- The Fast MA crosses below the Slow MA.
- Both the Fast and Slow MAs are below the Filter MA, indicating a downtrend.
- The EA ensures that only one trade is active at a time, preventing overtrading.
- Buy Signal:
-
Position Management:
- Trades are executed with the specified LotSize, along with predefined Take Profit and Stop Loss values in pips.
-
Signal-Only Mode:
- Set Enable_Trading to False to receive alerts for signals without automatically opening positions.
Important Notes:
-
Functionality Testing:
- The EA has been tested for functionality on the EURUSD currency pair with a 5 minutes timeframe. It can also be used on other Forex pairs and timeframes, but it is strongly recommended to verify its functionality and performance through backtesting.
-
Money Management:
- This EA does not include a built-in money management strategy. It is recommended that users implement their own risk management plan to ensure proper account protection and to align with their trading objectives.
-
Backtesting and Optimization:
- Perform thorough backtesting using MetaTrader's Strategy Tester to evaluate performance and adjust parameters.
-
Caution with Live Trading:
- Test the EA on a demo account before using it on a live account to ensure it aligns with your expectations and market conditions.