Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Tandem - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources

author EAcpu | 3 reads | 0 comments |

Tandem - expert for MetaTrader 5

Tandem - expert for MetaTrader 5

If you are new to pairs trading, you can find information in the literature section. The idea can be briefly described as follows:

If we compare charts of two similar assets side by side, we will see that they diverge for a certain distance and then converge again. This happens again and again. Why shouldn't we use it to make money?

Tandem - expert for MetaTrader 5

The Expert Advisor is set to EURUSD H1. GBPUSD is selected as the default associated currency pair ( symbol 2 variable or "indirect symbol"). The Expert Advisor tracks the market according to the program, but do not confuse it with synthetic products! Comprehensive analysis is based on constant averaging and dragging two assets together. In this case, the graphs simply overlap. But before overlaying, my Expert Advisor defines an unrestricted starting point. From there, assume the two pairs cross for the first time. We then scale symbol 2 so that its price fluctuation range is roughly similar to the range of the symbol on which the Expert Advisor is installed. Collect some stat range (Training Ground) candles. Find the maximum sign divergence for the period. Further, if the divergence is to the correct limit ("signal boundary correction") starting from the largest one occurs, a new position is opened. Or, to be more precise, open a pair of positions (one position per symbol). If the symbol continues to divergence, open a second pair after the same number of pips. The maximum number of such transactions is subject to the following limitations: Maximum Offer Variable ("Maximum Number of Transactions").

The correct distance variable ("coefficient length of separation search") changes the value of the training cycle for deeper analysis.

The Expert Advisor trades two currency pairs with direct and inverse correlation. The correlation switch ("correlation coefficient") is used for this purpose. However, you can also trade by analyzing the differences between two currency pairs. For example, instead of trading EURUSD and GBPUSD, you can trade EURGBP. To do this, enter the "EURGBP" (without quotes) cross variable ("Which pair to trade instead of two (cross)"). If you want to trade GBP EUR, specify the error value of the cross ("direct cross rate") variable in the Expert Advisor.

Retraining is performed by optimal ("retraining interval") candles after the knowledge gained during the last training period has expired.

The Expert Advisor has 2 signals for closing all trades. If the sign moves backwards the correction is closed ("Close Reduction Difference") from the maximum divergence to the percentage of open positions that reach profit .

The mqh include file contains auxiliary functions for the correct operation of the Expert Advisor.
MyMQL_v2.1.mqh - function for adjusting the Expert Advisor from the MQL4 programming language to MQL5;
PrintLog.mqh - necessary to create the benchmark .csv table in the Files folder when testing Expert Advisor. This table contains a history of account equity changes. This information can be used for detailed analysis of retracements during testing. In addition, the equity change graphs of various trading systems can be superimposed.

Tandem - expert for MetaTrader 5

Change history:

September 8, 2012 - Taking into account comments about possible "holes" in the history of indirect symbols, the EA trading code was improved.


Attachment download

📎 mymql_v2k1.mqh (15.42 KB)

📎 printlog.mqh (1.05 KB)

📎 tandem.mq5 (18.5 KB)

Source: MQL5 #955

Verification code Refresh