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

Exp_ColorX2MA_X2 - MetaTrader 5 Expert | Forex Indicators Download - MT4/MT5 Resources

author EAcpu | 3 reads | 0 comments |

Exp_ColorX2MA_X2 - expert for MetaTrader 5

Exp_ColorX2MA_X2 - expert for MetaTrader 5

Trend following trading system Exp_ColorX2MA_X2 is based on the signal Color X2MA of two indicators. The first indicator determines the direction of the slow trend based on the line color. The second indicator determines the moment when a position is opened when the color of the line changes. A signal is formed when the bar closes if 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 be traded = "Trade License" ; //+============== Trade License==============+
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 = "trade parameters slow" ; //+============== trade parameters==============+
Input ENUM_TIMEFRAMES time range = PERIOD_H6 ; //1 chart period of the trend
Input Smooth_Method MA_Method1=MODE_SMA_; //First smoothing average method
Input unit length 1= 12 ; //First smoothing depth
Input integer stage 1= 15 ; //First smoothing parameter,
3//---- For JJMA, in the range of -100...+100, it will affect the quality of the transition process;
//----For VIDIA, it is the CMO cycle, for AMA, it is the slow average cycle
Input Smooth_Method MA_Method2=MODE_JJMA; //Quadratic smoothing average method
Input unit length 2= 5 ; //Second smoothing depth
Input integer stage 2 = 15 ; //Second smoothing parameter,
3//---- For JJMA, in the range of -100...+100, it will affect the quality of the transition process;
//----For VIDIA, it is the CMO cycle, for AMA, it is the slow average cycle
Enter Applied_price_IPC=PRICE_CLOSE_; //Price constant
Input unit signal column = 1 ; //Get the bar index of the received signal
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 ENUM_TIMEFRAMES time range_= PERIOD_M30 ; //2 chart period for entry
Input Smooth_Method MA_Method1_=MODE_SMA_; //First smoothing average method
enterass="keyword">Unit length 1_= 12 ; //The first smoothing depth input integer stage 1_= 15 ; //The first smoothing parameter, 3//---- For JJMA, in the range of -100 ... +100, it will affect the quality of the transition process; //---- For VIDIA it is the CMO cycle, for AMA it is the slow average cycle input Smooth_Method MA_Method2_=MODE_JJMA; //Second smoothing average method input unit length 2_= 5 ; //Second smoothing depth input integer stage 2_= 15 ; //Second smoothing parameter, 3//---- For JJMA, in the range of -100...+100, it will affect the quality of the transition process; //---- For VIDIA it is the CMO cycle, for AMA it is the slow average cycle input Applied_price_IPC_=PRICE_CLOSE_; //Price constant input unit signal column_= 1 ; //Bar index receiving entry signal input Boolean value BuyPosClose_= wrong ; //Allow long position closing through signal input Boolean value sellPosClose_= wrong ; //Allow short position closing through signal //+----------------------------------------------------------------+

String parameters with text in the input parameter code are just for better visualization of the expert's input parameters window.

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

In order for the generated EA to run correctly, the compiled indicator files ColorX2MA.ex5 and ColorX2MA_HTF.ex5 must be in the <terminal data directory>\MQL5\indicator folder.

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 along with opening positions with brokers that offer the following services. You can download more variants of this library via the following link: Trading Algorithms .

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

2016 USD/JPY test results, H6 slow trend, M30 fast trend entry:

Exp_ColorX2MA_X2 - expert for MetaTrader 5

Figure 1. Example of trade on chart

Exp_ColorX2MA_X2 - expert for MetaTrader 5

Figure 2. Test result graph


Attachment download

📎Exp_ColorX2MA_X2.mq5 (24.76 KB)

📎 SmoothAlgorithms.mqh (130.2 KB)

📎 TradeAlgorithms.mqh (223.62 KB)

📎 ColorX2MA.mq5 (17.51 ​​KB)

📎 ColorX2MA_HTF.mq5 (19.92 KB)

Source: MQL5 #21001

Verification code Refresh