Are you ready to take your trading to the next level? The Exp_X2MA_JJRSX is a trend-following trading system designed specifically for MetaTrader 5. It utilizes the signals from the ColorX2MA and ColorJJRSX indicators to identify key market trends.
Here’s how it works: the ColorX2MA indicator helps you spot the primary slow trend direction, while the ColorJJRSX indicator identifies when the fast trend direction is reversing. An entry signal is triggered at the close of a bar when two crucial conditions are met:
- Both fast and slow trend signals align.
- The fast trend has changed direction.
Let’s dive into the EA inputs:
//| Input parameters of the EA indicator |
//+-------------------------------------------------+
inputstring Trade="Trade management"; //+============== TRADE MANAGEMENT ==============+
inputdouble MM=0.1; //Share of a deposit in a deal
input MarginMode MMMode=LOT; //lot value detection method
inputuint StopLoss_=1000; //stop loss in points
inputuint TakeProfit_=2000; //take profit in points
inputstring MustTrade="Trading permissions"; //+============== TRADING PERMISSIONS ==============+
inputint Deviation_=10; //max price deviation in points
inputbool BuyPosOpen=true; //Permission to enter a long position
inputbool SellPosOpen=true; //Permission to enter a short position
//+-------------------------------------------------+
//| Input parameters of the filter indicator |
//+-------------------------------------------------+
inputstring Filter="SLOW TREND PARAMETERS"; //+============== TREND PARAMETERS ==============+
inputENUM_TIMEFRAMES TimeFrame=PERIOD_H4; //1 Chart period for a trend
input Smooth_Method MA_Method1=MODE_SMA_; //first smoothing averaging method
inputuint Length1=12; //first smoothing depth
inputint Phase1=15; //first smoothing parameter,
//---- for JJMA within the range of -100 ... +100 it influences the quality of the transition process;
//---- For VIDIA it is a CMO period, for AMA it is a slow average period
input Smooth_Method MA_Method2=MODE_JJMA; //second smoothing averaging method
inputuint Length2=5; //second smoothing depth
inputint Phase2=15; //second smoothing parameter,
//---- for JJMA within the range of -100 ... +100 it influences the quality of the transition process;
//---- For VIDIA it is a CMO period, for AMA it is a slow average period
inputuint SignalBar=1; //bar index for getting an entry signal
inputbool BuyPosClose=true; //Permission to exit long positions by trend
inputbool SellPosClose=true; //Permission to exit short positions by trend
//+-------------------------------------------------+
//| Input parameters of the entry indicator |
//+-------------------------------------------------+
inputstring Input="ENTRY PARAMETERS"; //+=============== ENTRY PARAMETERS ===============+
inputENUM_TIMEFRAMES TimeFrame_=PERIOD_M30; //2 Chart period for an entry
inputuint JurXPeriod=8; //JurX period
inputuint JMAPeriod=3; //JMA period
inputint JMAPhase=100; //JMA averaging parameter,
// for JJMA it varies within the range -100 ... +100 and influences the quality of the transient period;
inputuint SignalBar_=1;//bar index for getting an entry signal
inputbool BuyPosClose_=false; //Permission to exit long positions by signal
inputbool SellPosClose_=false; //Permission to exit short positions by signal
//+-------------------------------------------------+
The string variables you see in the input code are there for a better visual representation in the EA's input window.
The ColorJJRSX_HTF and ColorX2MA_HTF indicators included in the EA are primarily for facilitating trend visualization during strategy testing. They won't be used in other operational modes.
For smooth operation, ensure you place the compiled files ColorX2MA.ex5, ColorX2MA_HTF.ex5, ColorJJRSX.ex5, and ColorJJRSX_HTF.ex5 in the <terminal_data_folder>\MQL5\Indicators directory.
A quick heads up: the TradeAlgorithms.mqh library file enables the use of Expert Advisors with brokers that offer nonzero spreads and allow setting Stop Loss and Take Profit during position opening. You can grab more options from the Trade Algorithms link.
During the tests outlined below, we used the default input parameters of the Expert Advisor, with no Stop Loss or Take Profit.

Fig. 1. Examples of trades on the chart
The testing results for 2015 on GBPUSD, with a slow trend on H4 and entries based on the fast trend on M30, are as follows:

Fig. 2. Testing results chart

Comments 0