The EA compares two instruments and opens opposite positions when these instruments diverge. Further, when the instruments converge, the EA closes positions on the total profit.

The EA works on all instruments, but it showed the best results on:
These tools have been selected and tested over a significant period of time. The choice of these tools is due to the fact that they are well correlated and do not diverge very far from each other. This provides insurance against long drawdowns.
I used M5 and M15 for the timeframe, but you can experiment on other timeframes as well.
Adviser for a given period of time (300 candlepower) compares two tools, and when the divergence of these tools opens opposite positions. Further, when the instruments converge, the EA closes positions on the total profit specified in the parameters or when changing the direction of convergence (color from red to blue or Vice versa). Closing when changing direction occurs only with a positive profit.
Advisor enough to put on one pair of the bunch. For example to trade in conjunction GBPUSD EURUSD is enough to put the EA on GBPUSD or EURUSD.
The EA draws both currencies on the chart and indicates the distance between them in columns.

In the lower left corner, the EA shows the earned profit.
In the upper right corner from the top down:
Balance – the current balance of the entire account.
Equity – the Current Equity of the account
Profit – current profit on open trades
Next, the line displays the profit at which the trades are closed. If the set closing equal to 0, then the EA on the basis of the lot calculates the required amount of closure.
Below on the right is information about the divergence of instruments.
Maximum is the maximum divergence in the control area (default is 300 candles)
current is the current divergence of the instruments.
Recent discovery here shows what value was last opened position.
Open-shows the divergence interval at which the following positions will be opened.
The EA is fully automatic, but for those who like to trade hands, I added 3 buttons to the lower right corner.
When you click on the manual control button, the EA stops opening and closing positions, but it makes all calculations and shows the divergence levels.
Open button-opens 2 counter positions for the selected instruments.
Close button-closes all positions.
The EA can be used as a semi-automatic. That is, to open positions with your hands, and then give the adviser to manage the closure or Vice versa to wait when the profit from the open positions Advisor suits us and close the transaction.

The parameters of the EA:

Lot-order volume
K_Lot – increase the volume of orders.
Start Delta – minimum divergence at which we open the first pair of orders. It is also used to open subsequent pairs.
Close when a loss is received-the EA will close all positions for a given loss, for example 100 usd
Close when profit is received-the EA will close all positions for a given profit, for example 100 usd. If 0 is specified, the EA will calculate the profit at which it is necessary to close positions depending on the lot and the divergence of instruments.

If after opening the first pair of positions, the divergence of instruments increases, the EA opens the second pair of orders with the lot multiplied by the coefficient (by default, 1 – without increasing the lot).
Usually, with such settings, the EA opens 1-2 pairs, but the market sometimes presents surprises.

Example of an extreme situation:

This is a table of comments to orders. The adviser specifically makes such comments, for ease of analysis. The EA opened the first pair at Delta 118.2, then the divergence increased by 100 and the EA opens the second pair 220.0 but the instruments went even further and the third pair of orders was opened at Delta 326.0. After that, there was a convergence and closing of all 6 positions in the total plus.

In this situation, you can close all positions in manual control without waiting for the instruments to converge. But you can wait for when the profit reaches usd 610,79 or change of color correlations in blue.
The EA works on a demo account without a key. For a real account, you need to buy it or open an account with an affiliate program.

The EA DOES not work in the tester as the MT4 tester is not designed for pair trading.
Those who will have questions or suggestions of improvement, are invited to the forum
There you can always download the latest versions of the EA. All new versions of the EA will have different keys, but for those who have already bought the key, all subsequent updates will be free.

Cm SMARTHEDGE 5.02 (188.4 KiB, 347 downloads)
188.4 KiB