• Overview
  • Reviews
  • Comments (3)
  • What's new

Divergent

The Divergent (version for MetaTrader 5) 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.


Features

  • 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


Parameters

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
  • Trace trades - Trace trades on the chart
  • 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
- Added Joint use parameter. Details are in the description
- Added a switch for tracing trades on the chart
- Improved the trailing stop operation
Version 1.2 - 2016.07.12
- New method for opening trades. Now, one trade is opened with the full volume. Partial closure is controlled by the Expert Advisor. This design allows to avoid excessive slippage when opening 2 similar orders and also increases the operation speed
- Added slippage parameter
- Added spread filter. If the spread is greater than the specified value, trades are not opened
- Now, the calculation of risk per trade is available for any account currencies and Forex instruments.
Version 1.1 - 2016.06.13
- Fixed stop order modification bug within the Breakeven function.
- Added the possibility to calculate lot depending on Risk per Trade for any pairs and currencies. In the Strategy Tester, use the account currency that matches one of the currencies of a selected pair. Otherwise use the fixed lot.
- Added Magic parameter. The EA can now work when there are orders opened by other EAs or manually.
- Parameter Timeframe has been removed. The EA now uses the timeframe on which it is running.
- Added trading modes:

0 - 1 order with TP1, Trailing - No, Breakeven - No
Valid p0arameters: TakeProfit1>0
TakeProfit2=0, Trailing=0, BreakEven=0

1 - 1 order with TP1, Trailing - Yes
Valid parameters: TakeProfit1>=0, Trailing>0
TakeProfit2=0, BreakEven=0

2 - 1 order with TP1, Breakeven - Yes
Valid parameters: TakeProfit1>0, BreakEven>TakeProfit1
TakeProfit2=0, Trailing=0

3 - 1 order with TP1, Trailing - Yes, Breakeven - Yes
Valid parameters: TakeProfit1>=0, BreakEven>Takeprofit and BreakEven<Trailing,
Trailing>TakeProfit1,
TakeProfit2=0

4 - 2 orders, BreakEven - No, Trailing - No
Valid parameters: TakeProfit1>0, TakeProfit2>0, TakeProfit1>TakeProfit2
Trailing=0, BreakEven=0

5 - 2 orders, Breakeven - Yes for 2 orders
Valid parameters: TakeProfit1>0, TakeProfit2>0, TakeProfit1>TakeProfit2
BreakEven<Max of TP
Trailing=0

6 - 2 orders, Trailing - Yes for 2 orders
Valid parameters: TakeProfit1>=0, TakeProfit2>=0, TakeProfit1>TakeProfit2
Trailing>0 and Trailing<Max of TP
BreakEven=0

7 - 2 orders, Trailing for second order after first TP
Valid parameters: TakeProfit1>0, TakeProfit2>=0, TakeProfit1>TakeProfit2
Trailing>0 and Trailing<Max of TP
BreakEven=0

A position is divided into two equal parts. If the lot is odd, the position with TP1 is rounded to a larger value.
For the ease of optimization, the EA shall terminate if its parameters are incorrect. Be sure to check all parameters.

- Added time based trading modes.

Single hour mode - the EA only searches for entries during the specified hour. The mode is designed for optimization, as well as it allows finding the best trading hours. Specify a value 0 to 23 with a step of 1 in order to test each hour separately.

Hour range mode - trading within the specified time range. The start hour is always earlier 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. Format: hour/dist;hour/dist;.../...