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

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

author EAcpu | 5 reads | 0 comments |

Exp_XROC2_VG_X2 - expert for MetaTrader 5

Exp_XROC2_VG_X2 - expert for MetaTrader 5

Exp_XROC2_VG_X2 - expert for MetaTrader 5

Exp_XROC2_VG_X2 - expert for MetaTrader 5

Exp_XROC2_VG_X2 - expert for MetaTrader 5

Exp_XROC2_VG_X2 The trend following trading system generates the signal XROC2_VG indicator based on two signals. The first indicator determines the direction of the slow trend based on the position of the main and signal lines. The second indicator determines the moment to start trading when the line is crossed or touched. An entry signal is generated at bar close if the following two conditions are met:

//+------------------------------------------------+
//|Input parameters of EA indicator|
//+------------------------------------------------+
Enter String Trade = "Trade Management" ; //+================ Trade Management================+
Enter double MM= 0.1 ; //Share of deposit in a transaction
Enter the margin mode MMMode=LOT; //Lot size detection method
Input unit Stop loss_= 1000 ; //Stop loss points
Input unit profit_= 2000 ; //Profit in points
Input string must trade = "Trade Permit" ; //+================ Trade Permit==============+
Enter integer Deviation_= 10 ; //Maximum price deviation (in points)
Enter Boolean BuyPosOpen= True ; //Allow entry into long position
Enter a Boolean value SELL OPEN = TRUE ; //Allow short positions to be opened
//+------------------------------------------------+
//|Input parameters for filtering indicators |
//+------------------------------------------------+
input string filter = "slow trend parameter" ; //+============== trend parameter==============+
Input ENUM_TIMEFRAMES time range = PERIOD_H6 ; //1 chart period of the trend

Input unit ROCP period 1= 8 ; Input Smooth_Method MA_Method1=MODE_JJMA; //Average method of the first indicator
Input unit length 1= 5 ; //The depth of the first smoothing
Input integer stage 1= 15 ; //Parameters for the first smoothing,
//---- For JJMA in the range of -100 ... +100, it affects the quality of the transition process;
//----For VIDIA, it is the CMO cycle, for AMA, it is the slow average cycle
Input unit ROCP period 2= 14 ; Input Smooth_Method MA_Method2=MODE_JJMA; //Average method of the second indicator
Input unit length 2 = 5 ; //The depth of the second smoothing
Input integer stage 2= 15 ; //Parameters for the second smoothing,
//---- For JJMA in the range of -100 ... +100, it affects the quality of the transition process;
//----For VIDIA, it is the CMO cycle, for AMA, it is the slow average cycle
Enter ENUM_TYPE ROCType=MOM; Enter unit signal column = 1 ; //Bar index to receive entry signals
Input boolean buy close = true ; //Allow exit of long positions on trend
Enter a Boolean value Sell transaction close = true ; //Allow exit of short positions according to trend
//+------------------------------------------------+
//|Input parameters of the entry indicator |
//+------------------------------------------------+
input string input = "input parameter" ; //+================ input parameter==============+
Enter</span> ENUM_TIMEFRAMES time range_= PERIOD_M30 ; //Chart period of 2 entries input unit ROCPeriod1_= 8 ; input Smooth_Method MA_Method1_=MODE_JJMA; //average method input unit length of the first indicator 1_= 5 ; //depth of the first smoothing input integer phase 1_= 15 ; //parameters of the first smoothing, //---- for -100... JJMA in the +100 range, which affects the quality of the transition process; //---- For VIDIA it is the CMO period, for AMA it is the slow average period input unit ROCPeriod2_= 14 ; input Smooth_Method MA_Method2_=MODE_JJMA; //The average method input unit length of the second indicator 2_= 5 ; //The depth of the second smoothing input integer phase 2_= 15 ; //The parameters of the second smoothing, //---- For JJMA in the range -100 ... +100, it affects the quality of the transition process; //---- For VIDIA it is the CMO period, for AMA it is the slow average period Enter ENUM_TYPE ROCType_=MOM; Enter the unit signal bar_= 1 ; //Bar index to receive entry signals Enter Boolean BuyPosClose_= False ; // Allow long closing by signal Enter Boolean SellPosClose_= False ; //Allow short positions to be closed via signals

The string variable containing the text in the input parameters code is only used for better visualization of the EA input parameters window.

The XROC2_VG_HTF indicator in the EA is only used for more convenient visualization of trends in the strategy tester, they are inactive in other operating modes.

In order for the compiled Expert Advisor to run correctly, you should add the compiled XROC2_VG.ex5 and XROC2_VG_HTF.ex5 indicator files to \MQL5\Indicators.

Please note that the TradeAlgorithms.mqh library file allows trading Expert Advisors with non-zero spreads and the option to set Stop Loss and Take Profit with brokers that offer the following services during position opening . You can download more variants of this library via the following link: Trading Algorithms .

The default input parameters of the Expert Advisor were used during the tests shown below. Stop Loss and Take Profit were not used during testing.

Exp_XROC2_VG_X2 - expert for MetaTrader 5

Figure 1. Example of trade on chart

AUDUSD test results in 2015, H6 is a slow trend and M30 is a fast trend entry:

Exp_XROC2_VG_X2 - expert for MetaTrader 5

Figure 2. Test result graph


Attachment download

📎 Exp_XROC2_VG_X2.mq5 (25.63 KB)

📎 SmoothAlgorithms.mqh (130.2 KB)

📎 TradeAlgorithms.mqh (185.34 KB)

📎 XROC2_VG.mq5 (19.84 KB)

📎 XROC2_VG_HTF.mq5 (25.43 KB)

Source: MQL5 #18526

Verification code Refresh