Momentum Divergence V2 EA
- Experts
- Versione: 1.0
- Attivazioni: 5
Below is a ready-to-paste English description for the MQL5 Market editor. It is written to sound professional and attractive without making unrealistic profit guarantees.
[b]Momentum Divergence V2 – Professional Momentum Divergence Expert Advisor for MetaTrader 5[/b]
Momentum Divergence V2 is a fully configurable Expert Advisor designed to identify [b]regular bullish and bearish momentum divergences[/b] directly from confirmed market structure.
The strategy compares price swing points with the Momentum indicator and waits for a completed divergence pattern before generating a trading signal.
[b]Bullish divergence:[/b]
Price creates a lower low while Momentum creates a higher low.
[b]Bearish divergence:[/b]
Price creates a higher high while Momentum creates a lower high.
The EA uses [b]confirmed pivots and closed candles only[/b]. This avoids generating signals from unfinished candles and helps maintain consistent behaviour between historical testing and live execution.
The product includes a complete risk-management and position-management system, allowing traders to adapt the EA to different symbols, timeframes, account sizes and trading conditions.
[b]Main Features[/b]
[list]
[]Regular bullish and bearish Momentum Divergence detection
[]Signals based only on closed candles
[]Confirmed pivot-based divergence detection
[]Configurable Momentum period
[]Adjustable pivot strength and divergence lookback
[]Minimum price and Momentum divergence filters
[]BUY and SELL trading
[]Optional long-term EMA trend filter
[]ATR volatility filter
[]Candle body volatility filter
[]Fixed lot or percentage-risk position sizing
[]Optional compounding based on current account equity
[]Maximum position limit
[]Maximum trades per day
[]Entry cooldown
[]Maximum drawdown protection
[]Daily loss protection
[]Consecutive-loss protection
[]Spread filter
[]Configurable trading sessions
[]Blocked trading interval
[]Trading-day selection
[]ATR-based or fixed Stop Loss
[]Fixed, ATR-based or Risk/Reward Take Profit
[]Break-even management
[]Trailing Stop
[]Friday position management
[]Optional exit on opposite divergence signal
[]Separate Magic Number for position identification
[]Detailed journal diagnostics
[/list]
[b]Signal Logic[/b]
[b]BUY[/b]
A bullish signal can occur when:
[list]
[]A new confirmed price pivot low is detected
[]The new price low is lower than the previous pivot low
[]Momentum at the new pivot is higher than Momentum at the previous pivot
[]All enabled filters and risk conditions are satisfied
[/list]
[b]SELL[/b]
A bearish signal can occur when:
[list]
[]A new confirmed price pivot high is detected
[]The new price high is higher than the previous pivot high
[]Momentum at the new pivot is lower than Momentum at the previous pivot
[]All enabled filters and risk conditions are satisfied
[/list]
The EA generates the divergence signal only after the second pivot has been confirmed.
[b]Money Management[/b]
Momentum Divergence V2 supports two position-sizing modes:
[list]
[][b]Fixed Lot[/b] – uses the selected fixed trading volume
[][b]Risk Percent[/b] – automatically calculates trading volume according to the selected percentage of account capital and Stop Loss distance
[/list]
When compounding is enabled, position size is calculated from the current account equity.
[b]Risk Protection[/b]
The EA contains several independent safety controls:
[list]
[]Maximum account drawdown limit
[]Maximum daily loss limit
[]Maximum consecutive losses
[]Maximum simultaneous positions
[]Maximum trades per day
[]Spread limitation
[]Trading-hours filter
[]Blocked trading period
[/list]
These protections can be individually enabled or disabled.
[b]Stop Loss and Take Profit[/b]
Stop Loss can be calculated using:
[list]
[]Fixed points
[]ATR multiplier
[/list]
Take Profit can be calculated using:
[list]
[]Fixed points
[]Risk/Reward ratio
[*]ATR multiplier
[/list]
This allows the strategy to adapt its trade management to different market volatility conditions.
[b]Position Management[/b]
The EA includes:
[list]
[]Break-even protection
[]Configurable profit trigger
[]Configurable profit lock
[]Trailing Stop
[]Trailing activation level
[]Trailing distance
[]Trailing step
[]Optional closing on opposite signal
[/list]
[b]Trading Sessions[/b]
Trading can be restricted by:
[list]
[]Starting hour and minute
[]Ending hour and minute
[]Individual weekdays
[]Custom blocked trading interval
[*]Friday closing time
[/list]
The blocked interval can also optionally close existing EA positions.
[b]Recommended Testing[/b]
Before using the Expert Advisor on a live account, users should test their selected configuration in the MetaTrader 5 Strategy Tester using:
[list]
[]Every tick based on real ticks
[]The same symbol intended for live trading
[]The same timeframe intended for live trading
[]Realistic spread and execution conditions
[/list]
Different brokers may provide different spreads, tick history, symbol specifications and execution conditions. Results may therefore vary between brokers.
[b]Inputs / Parameters[/b]
[b]01. General Settings[/b]
[list]
[][b]InpEnableTrading[/b] – enables or disables new trades.
[][b]InpMagicNumber[/b] – unique identification number used by the EA.
[][b]InpTradeComment[/b] – comment attached to orders.
[][b]InpShowJournalMessages[/b] – enables informational journal messages.
[/list]
[b]02. Symbol and Timeframe[/b]
[list]
[][b]InpTradeSymbol[/b] – trading symbol. Leave empty to use the current chart symbol.
[][b]InpTimeframe[/b] – timeframe used for signal calculation.
[/list]
[b]03. Trade Directions[/b]
[list]
[][b]InpAllowBuy[/b] – enables BUY trades.
[][b]InpAllowSell[/b] – enables SELL trades.
[/list]
[b]04. Entry Timing[/b]
[list]
[][b]InpOneDecisionPerBar[/b] – limits signal processing to one decision per new candle.
[][b]InpCooldownMinutes[/b] – minimum delay between new entries.
[/list]
[b]05. Money Management[/b]
[list]
[][b]InpLotMode[/b] – Fixed Lot or Risk Percent sizing.
[][b]InpFixedLot[/b] – fixed lot size when Fixed Lot mode is selected.
[*][b]InpRiskPercent[/b] – percentage of account capital risked per trade.
[/list]
[b]05A. Compounding[/b]
[list]
[*][b]InpUseCompounding[/b] – calculates percentage-risk position size from current account equity.
[/list]
[b]06. Volume Limits[/b]
[list]
[][b]InpMinimumLotOverride[/b] – optional custom minimum lot.
[][b]InpMaximumLot[/b] – maximum permitted lot size.
[/list]
[b]07. Position Limits[/b]
[list]
[][b]InpMaxPositions[/b] – maximum number of simultaneous EA positions.
[][b]InpAvoidForeignPosition[/b] – blocks entries when another EA or manual position exists on the same symbol.
[/list]
[b]08. Daily Trade Limits[/b]
[list]
[*][b]InpMaxTradesPerDay[/b] – maximum number of entries allowed per day.
[/list]
[b]09. Drawdown Protection[/b]
[list]
[][b]InpUseMaxDrawdown[/b] – enables maximum drawdown protection.
[][b]InpMaxDrawdownPct[/b] – maximum permitted equity drawdown percentage.
[*][b]InpCloseOnMaxDrawdown[/b] – optionally closes EA positions when the limit is reached.
[/list]
[b]10. Daily Loss Protection[/b]
[list]
[][b]InpUseDailyLossLimit[/b] – enables the daily loss limit.
[][b]InpMaxDailyLossPct[/b] – maximum permitted daily loss percentage.
[*][b]InpCloseOnDailyLoss[/b] – optionally closes EA positions when the daily limit is reached.
[/list]
[b]11. Consecutive Loss Protection[/b]
[list]
[][b]InpUseConsecutiveLossLimit[/b] – enables consecutive-loss protection.
[][b]InpMaxConsecutiveLosses[/b] – maximum permitted consecutive losing trades.
[/list]
[b]12. Spread and Deviation[/b]
[list]
[][b]InpUseSpreadFilter[/b] – enables the spread filter.
[][b]InpMaxSpreadPoints[/b] – maximum permitted spread in points.
[*][b]InpDeviationPoints[/b] – maximum order execution deviation.
[/list]
[b]13. Trading Session[/b]
[list]
[][b]InpUseTradingHours[/b] – enables session filtering.
[][b]InpStartHour / InpStartMinute[/b] – trading session start.
[*][b]InpEndHour / InpEndMinute[/b] – trading session end.
[/list]
[b]13A. Blocked Trading Interval[/b]
[list]
[][b]InpUseBlockedInterval[/b] – enables the blocked trading period.
[][b]InpBlockedStartHour / InpBlockedStartMinute[/b] – start of blocked interval.
[][b]InpBlockedEndHour / InpBlockedEndMinute[/b] – end of blocked interval.
[][b]InpClosePositionsDuringBlockedInterval[/b] – optionally closes EA positions during this interval.
[/list]
[b]14. Trading Days[/b]
[list]
[][b]InpTradeMonday[/b] – allow Monday trading.
[][b]InpTradeTuesday[/b] – allow Tuesday trading.
[][b]InpTradeWednesday[/b] – allow Wednesday trading.
[][b]InpTradeThursday[/b] – allow Thursday trading.
[][b]InpTradeFriday[/b] – allow Friday trading.
[][b]InpTradeSaturday[/b] – allow Saturday trading.
[*][b]InpTradeSunday[/b] – allow Sunday trading.
[/list]
[b]15. Momentum Divergence Entry[/b]
[list]
[][b]InpMomentumPeriod[/b] – Momentum indicator period.
[][b]InpMomentumPrice[/b] – applied price used by Momentum.
[][b]InpPivotStrength[/b] – number of candles required on each side to confirm a pivot.
[][b]InpDivergenceLookback[/b] – maximum historical search range for divergence pivots.
[][b]InpMinPivotSeparation[/b] – minimum distance between compared pivots.
[][b]InpMaxPivotSeparation[/b] – maximum distance between compared pivots.
[][b]InpMinPriceDifferencePoints[/b] – minimum price difference required between pivots.
[][b]InpMinMomentumDifference[/b] – minimum Momentum difference required between pivots.
[/list]
[b]16. Long-Term Trend Filter[/b]
[list]
[][b]InpUseTrendFilter[/b] – enables the EMA trend filter.
[][b]InpTrendEMAPeriod[/b] – EMA period used for trend confirmation.
[][b]InpMAMethod[/b] – moving-average calculation method.
[][b]InpMAPrice[/b] – price source used by the moving average.
[/list]
[b]18. ATR Volatility Filter[/b]
[list]
[][b]InpUseATRFilter[/b] – enables ATR volatility filtering.
[][b]InpATRPeriod[/b] – ATR calculation period.
[][b]InpMinATRPoints[/b] – minimum ATR required.
[][b]InpMaxATRPoints[/b] – maximum ATR permitted.
[/list]
[b]19. Candle Body Filter[/b]
[list]
[][b]InpUseCandleBodyFilter[/b] – enables candle-body filtering.
[][b]InpMinBodyATRRatio[/b] – minimum candle-body size relative to ATR.
[*][b]InpMaxBodyATRRatio[/b] – maximum candle-body size relative to ATR.
[/list]
[b]20. Stop Loss[/b]
[list]
[][b]InpUseStopLoss[/b] – enables Stop Loss.
[][b]InpStopMode[/b] – fixed-points or ATR-based Stop Loss.
[][b]InpStopLossPoints[/b] – fixed Stop Loss distance.
[][b]InpStopATRMultiplier[/b] – ATR multiplier used for dynamic Stop Loss.
[/list]
[b]21. Take Profit[/b]
[list]
[][b]InpUseTakeProfit[/b] – enables Take Profit.
[][b]InpTakeProfitMode[/b] – fixed, Risk/Reward or ATR-based Take Profit.
[][b]InpTakeProfitPoints[/b] – fixed Take Profit distance.
[][b]InpRiskRewardRatio[/b] – Take Profit distance relative to Stop Loss.
[*][b]InpTakeATRMultiplier[/b] – ATR multiplier used for Take Profit.
[/list]
[b]22. Break Even[/b]
[list]
[][b]InpUseBreakEven[/b] – enables break-even management.
[][b]InpBreakEvenTrigger[/b] – profit distance required before break-even activates.
[*][b]InpBreakEvenLock[/b] – number of points locked beyond entry price.
[/list]
[b]23. Trailing Stop[/b]
[list]
[][b]InpUseTrailingStop[/b] – enables the Trailing Stop.
[][b]InpTrailingStart[/b] – profit distance required before trailing begins.
[][b]InpTrailingDistance[/b] – distance maintained between current price and Stop Loss.
[][b]InpTrailingStep[/b] – minimum Stop Loss movement step.
[/list]
[b]24. Friday Management[/b]
[list]
[][b]InpCloseFridayPositions[/b] – enables automatic Friday closing.
[][b]InpFridayCloseHour / InpFridayCloseMinute[/b] – configured Friday closing time.
[/list]
[b]25. Signal-Based Exit[/b]
[list]
[*][b]InpCloseOnOppositeSignal[/b] – closes positions when a confirmed opposite divergence signal occurs.
[/list]
[b]26. Execution Diagnostics[/b]
[list]
[*][b]InpPrintSignalValues[/b] – prints detailed divergence and indicator values to the MetaTrader journal.
[/list]
[b]Important[/b]
Momentum Divergence V2 is an automated trading tool, not a guarantee of future profitability. Historical performance does not guarantee future results.
Always test the EA with your broker's trading conditions and use risk settings appropriate for your account.
