Home System Trading Post

Unlocking the Power of Exp_X2MA_JJRSX: A Trend-Following EA for MetaTrader 5

Attachments
16673.zip (45.81 KB, Download 0 times)

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 |
//+-------------------------------------------------+
input string Trade="Trade management"; //+============== TRADE MANAGEMENT ==============+
input double MM=0.1; //Share of a deposit in a deal
input MarginMode MMMode=LOT; //lot value detection method
input uint StopLoss_=1000; //stop loss in points
input uint TakeProfit_=2000; //take profit in points
input string MustTrade="Trading permissions"; //+============== TRADING PERMISSIONS ==============+
input int Deviation_=10; //max price deviation in points
input bool BuyPosOpen=true; //Permission to enter a long position
input bool SellPosOpen=true; //Permission to enter a short position
//+-------------------------------------------------+
//| Input parameters of the filter indicator |
//+-------------------------------------------------+
input string Filter="SLOW TREND PARAMETERS"; //+============== TREND PARAMETERS ==============+
input ENUM_TIMEFRAMES TimeFrame=PERIOD_H4; //1 Chart period for a trend
input Smooth_Method MA_Method1=MODE_SMA_; //first smoothing averaging method
input uint Length1=12; //first smoothing depth
input int 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
input uint Length2=5; //second smoothing depth
input int 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
input uint SignalBar=1; //bar index for getting an entry signal
input bool BuyPosClose=true; //Permission to exit long positions by trend
input bool SellPosClose=true; //Permission to exit short positions by trend
//+-------------------------------------------------+
//| Input parameters of the entry indicator |
//+-------------------------------------------------+
input string Input="ENTRY PARAMETERS"; //+=============== ENTRY PARAMETERS ===============+
input ENUM_TIMEFRAMES TimeFrame_=PERIOD_M30; //2 Chart period for an entry
input uint JurXPeriod=8; //JurX period
input uint JMAPeriod=3; //JMA period
input int JMAPhase=100; //JMA averaging parameter,
// for JJMA it varies within the range -100 ... +100 and influences the quality of the transient period;
input uint SignalBar_=1;//bar index for getting an entry signal
input bool BuyPosClose_=false; //Permission to exit long positions by signal
input bool 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

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

Fig. 2. Testing results chart

Related Posts

Comments (0)