Exp_AbsolutelyNoLagLwma_X2 - MetaTrader 5 Expert - MT4/MT5 Resources


Trend following trading system Exp_AbsolutelyNoLagLwma_X2 AbsolutelyNoLagLwma signal based on 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 unit length = 7 ; // smoothing depth Enter Applied_price_IPC=PRICE_CLOSE_; // price constant Input unit signal field = 1 ; // Number of bars for obtaining entry signals Enter boolean Buy Close = true ; // Allow closing positions on trend Enter a Boolean value Sell transaction close = true ; // Allow closing 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 unit length_= 7 ; // Smoothing depth Enter Applied_price_IPC_=PRICE_CLOSE_; // price constant Enter the unit signal column_= 1 ; // Get the bar number of the entry signal Enter boolean BuyPosClose_= false ; // Allow closing of long positions via signals Enter boolean SellPosClose_= False ; // Allow closing short positions via signals //+------------------------------------------------+
String parameters with text in the input parameter code are just for better visualization of the expert's input parameters window.
The indicator Lwma_HTF is absolutely delay-free and is designed only for easier visualization of trends in the strategy tester; and they do not work in any other mode.
In order for the generated EA to run correctly, the compiled indicator files Absolute NoLagLwma.ex5 and Absolute NoLagLwma_HTF.ex5 must be in the <Terminal Data Directory>\MQL5\Indicators 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:

Figure 1. Example of trade on chart

Figure 2. Test result graph
Attachment download
📎 tradealgorithms.mqh (223.62 KB)
📎absolutelynolaglwma.mq5 (19.73 KB)
📎 absolutelynolaglwma_htf.mq5 (17.12 KB)
📎 exp_absolutelynolaglwma_x2.mq5 (20.24 KB)
Source: MQL5 #20976
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •