• Overview
  • Reviews (1)
  • Comments (31)
  • What's new

PairsTrading MT5

The EA identifies divergences in two correlated currency pairs and trades in the direction where they converge back.

Working timeframe: M30


Input parameters

  • MagicNumber - identification number for the EA.
  • OrdersComment - comment to order, automatic if an empty value is set.
  • Lots - lot size.
  • DepoPer001Lot - automatic lot calculation (specify the balance per 0.01 lot) (if 0, the value from 'Lots' parameter is used).
  • TimeFrame - working timeframe.
  • Symbol #2 - correlated currency.
  • Symbol #2 reverse - currency #2 with a reverse correlation to the current.
  • Symbol #2 lot - lot of currency #2, automatic if a zero value is set.
  • TradeType - drop-down list for selecting the trade direction:
    • +Sell/Buy | -Buy/Sell - standard, for pairs with direct correlation.
    • +Sell/Sell | -Buy/Buy - pairs with inverse correlation require this or the next value.
    • +Buy/Buy | -Sell/Sell - pairs with inverse correlation require this or the previous value.
  • Min Correlation - minimum divergence for opening orders, in the range of 0.1 - 0.5.
  • Open signal shift - offset of the signal to open. If set to "0", the current incomplete bar; if "1", the previous closed bar, etc.
  • Close signal shift - offset of the signal to close. If set to "0", the current incomplete bar; if "1", the previous closed bar, etc.
  • Min dist reopen (pips) - step in points for opening additional orders in case of a repeated signal.
  • Max spread - the maximum spread for opening new orders.
  • Hour start - hour to start searching for the entry signals.
  • Minute start - minute to start searching for the entry signals.
  • Hour end - hour to stop searching for the entry signals.
  • Minute end - minute to stop searching for the entry signals.
  • Close only in profit ($/lot) - profit value, at which closing orders is allowed.
  • Exit minutes - time for closing a trade, in case there were no other signals to close.
  • Profit time exit ($/lot) - profit value, at which closing orders by time is allowed.
  • Trail start ($/lot) - the number of points to start the trailing stop by equity.
  • Trail stop ($/lot) - trailing distance.
  • Stop loss ($/lot) - stop loss in currency.
  • Take profit ($/lot) - take profit in currency.

The value of parameters specified with ($/lot) are multiplied by the lot, so as not to change them as the lot size increases. Thus, if a parameter value is 1000 and lot is 0.1, position will be closed upon reaching a profit of >= $10.

The EA should be attached to one currency only, there is no need to attach the EA to the currency specified in Symbol #2.

Adam Goman
476
Adam Goman 2017.09.12 12:47 
 

12.9.17 - Автору 5* за оперативную поддержку. О результатах позже.

Version 3.0 2018.10.16
Increased the speed of calculation of the indicator.
Fixed minor bugs.
Version 2.9 2018.08.07
The frequency of the opening of orders for both currency pairs has been increased.
Version 2.8 2018.03.05
Bug fix in info messages.
Version 2.7 2018.02.08
Added check of opening a pair of orders and checking their volume, if there is a mismatch, repeated attempts to open, or opening an order for the missing volume.
Version 2.4 2017.10.03
Added parameter for selecting the direction of deals
Added parameters analogous to Stop loss and Take profit
Version 2.3 2017.09.26
Added the ability to change order comments
Added Autolot, parameter DepoPer001Lot
Added the ability to change the lot of the second currency
Version 2.2 2017.09.20
Added filter to search for entry points only at a certain time
Version 2.1 2017.09.13
Bug fixes on suffix pairs.