If you're into trend-following strategies, let me introduce you to the Exp_WAMI_Cloud_X2, a nifty trading system designed for MetaTrader 5. This system leverages signals from two powerful indicators: WAMI. The first indicator helps pinpoint the direction of the slow trend based on where the main and signal lines are positioned. The second indicator comes into play to signal when it's time to enter a trade, specifically when these lines intersect.
A signal is generated as a bar closes, provided that two crucial conditions are met:
- Both the fast and slow trend signals align.
- The fast trend direction has shifted.
Input Parameters for the Expert Advisor
//+-------------------------------------------------+//| Input Parameters of the EA Indicator |//+-------------------------------------------------+sinputstring Trade="Trade Management"; //+============== TRADE MANAGEMENT ==============+inputdouble MM=0.1; //Share of deposit in a dealinput MarginMode MMMode=LOT; //Lot value detection methodinputuint StopLoss_=1000; //Stop Loss in pointsinputuint TakeProfit_=2000; //Take Profit in pointssinputstring MustTrade="Trade Permissions"; //+============== TRADE PERMISSIONS ==============+inputint Deviation_=10; //Max price deviation in pointsinputbool BuyPosOpen=true; //Permission to enter long positionsinputbool SellPosOpen=true; //Permission to enter short positions//+-------------------------------------------------+//| Input Parameters of the Filter Indicator |//+-------------------------------------------------+sinputstring Filter="SLOW TREND PARAMETERS"; //+============== TREND PARAMETERS ==============+inputENUM_TIMEFRAMES TimeFrame=PERIOD_H6; //1 Chart period for the trendinputuint InpPeriodMA1 = 4 // First MA periodinputENUM_MA_METHOD InpMethodMA1 = MODE_SMA // First MA methodinputuint InpPeriodMA2 = 13 // Second MA periodinputENUM_MA_METHOD InpMethodMA2 = MODE_SMA // Second MA methodinputuint InpPeriodMA3 = 13 // Third MA periodinputENUM_MA_METHOD InpMethodMA3 = MODE_SMA // Third MA methodinputuint InpPeriodSig = 4 // Signal MA periodinputENUM_MA_METHOD InpMethodSig = MODE_SMA // Signal MA methodinputENUM_APPLIED_PRICE InpAppliedPrice = PRICE_CLOSE // Applied priceinputuint SignalBar=1; // bar number to receive the entry signalinputbool BuyPosClose=true; // Permission to close long positions by trendinputbool SellPosClose=true; // Permission to close short positions by trend//+-------------------------------------------------+//| Input Parameters of the Entry Indicator |//+-------------------------------------------------+sinputstring Input="ENTRY PARAMETERS"; //+=============== ENTRY PARAMETERS ===============+inputENUM_TIMEFRAMES TimeFrame_=PERIOD_M30; //2 Chart period for entry inputuint InpPeriodMA1_ = 4 // First MA periodinputENUM_MA_METHOD InpMethodMA1_ = MODE_SMA // First MA methodinputuint InpPeriodMA2_ = 13 // Second MA periodinputENUM_MA_METHOD InpMethodMA2_ = MODE_SMA // Second MA methodinputuint InpPeriodMA3_ = 13 // Third MA periodinputENUM_MA_METHOD InpMethodMA3_ = MODE_SMA // Third MA methodinputuint InpPeriodSig_ = 4 // Signal MA periodinputENUM_MA_METHOD InpMethodSig_ = MODE_SMA // Signal MA methodinputENUM_APPLIED_PRICE InpAppliedPrice_ = PRICE_CLOSE // Applied priceinputuint SignalBar_=1; // bar number to receive an entry signalinputbool BuyPosClose_=false // Permission to close long positions by signalinputbool SellPosClose_=false // Permission to close short positions by signal//+-------------------------------------------------+
Just a heads up: the string parameters in the code are there for better visualization in the input parameter window of the expert.
The indicators, WAMI_Cloud_HTF, integrated into the EA, are primarily for visualizing trends in the Strategy Tester and won’t function in other modes.
For the EA to run smoothly, ensure that the compiled files WAMI.ex5 and WAMI_Cloud_HTF.ex5 are located in the <terminal_data_directory>\MQL5\Indicators folder.
Also, don’t forget that the TradeAlgorithms.mqh library file allows you to use Expert Advisors with brokers that offer a nonzero spread and the option to set Stop Loss and Take Profit at the same time as position opening. You can find more variations of this library at this link: Trade Algorithms.
During the tests shown below, we used the default input parameters for the Expert Advisor. Notably, Stop Loss and Take Profit were not applied in these tests.
Here’s a look at the testing results for 2016 on the EURUSD, with the slow trend analyzed on H4 and entry signals generated from the fast trend on M30:

Fig 1. Examples of deals on the chart

Fig. 2. Testing results chart

Comments 0