• Overview
  • Reviews
  • Comments
  • What's new

Divergent MT5

The Divergent MT5 (version for MetaTrader 4) Expert Advisor analyzes the divergence if peaks of the MACD indicator and peaks of the chart to find market entries. The EA enters the market on the reversal of the main movement. It opens market orders at the open of a candlestick after a pattern has been formed.


  • Can operate on any instruments and timeframes
  • Calculation of risk per trade for any account currencies and instruments.
  • 8 position management modes
  • Flexible adjustment of the operation hours
The Expert Advisor works only in the netting mode. For more information about netting and hedging see the article


Operation hours

  • Single hour mode - the EA only works during one fixed hour. Created for the EA optimization and analysis of separate results of each hour. For optimization, set it from 0 to 23 with a step of 1
  • Hour range mode - operation during a specified time range. The start hour is always less than the end hour
  • Custom hours mode - operation during specified hours from a list. For each hour, you can individually set the key parameter Min Distance. The format of the parameter string: 5/7;6/8;11/10;12/9, where work hour/Min Distance;work hour/Min Distance

The Trade Logic

  • Fast ЕМА - the period of the fast Moving Average of the MACD indicator
  • Slow EMA - the period of the slow Moving Average of the MACD indicator
  • Type price MACD
  • Min time between macd peaks - the minimal distance between peaks of the MACD histogram in a pattern (see screenshots)
  • Max time between macd peaks - the maximum time for the entire pattern to be formed
  • Min distance between chart peaks - the minimal distance between peaks on the chart (see screenshots)
  • Slippage - allowed slippage when opening a trade
  • Spread filter - Maximum allowed spread value when opening a trade. If the spread is greater, the trade is not opened

Money Management and Position Management

  • Risk per trade - risk calculated depending on the specified StopLoss. If 0, the fixed lot value Volume is used
  • Volume - total position volume. To be ignored if the value of Risk per trade is specified
  • TakeProfit1 - Take Profit of the first part of the position. The position is split into 2 equal parts. Rounding is in favor of the first part
  • TakeProfit2 - Take Profit of the second part of the position
  • StopLoss - the common Stop Loss of a position
  • Trailing Stop - Trailing Stop value. The trailing stop is implemented the same way as in the terminal
  • Breakeven level - the distance in points, reaching which the stop level is to be moved to breakeven

Position management modes

  • 0 - 1 part with TP1, Trailing - No, Breakeven - No
  • 1 - 1 part with TP1, Trailing - Yes
  • 2 - 1 part with TP1, Breakeven - Yes
  • 3 - 1 part with TP1, Trailing - Yes, Breakeven - Yes
  • 4 - 2 parts, BreakEven - No, Trailing - No
  • 5 - 2 parts, Breakeven - Yes for 2 parts
  • 6 - 2 parts, Trailing - Yes for 2 parts
  • 7 - 2 parts, Trailing for second part after first TP

Other parameters

  • Joint use - Joint use. If true, trades are opened by the EA regardless of whether there are more open positions. If false, trades are opened by the EA only when there are no other open positions
  • Magic for orders - unique IDs of the orders opened by the Expert Advisor
No reviews
Version 1.4 2016.07.27
- Changed the operation of the last mode of position maintenance (2 parts, Trailing for second part after first TP). Now the stop loss is immediately moved to breakeven after closing the first part, regardless of the trailing value. After that, trailing works according to the normal conditions for the remaining part of the position.
Version 1.3 2016.07.19
- Fixed error with identification of open position.
- Added Joint use parameter. Details are in the description.
- Added a warning and restriction of the EA operation (netting mode only).