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


Trend Following Trading System Exp_Sinewave2_X2 Signal Sinewave 2 based on two indicators The first indicator determines the direction of the slow trend based on the position of the main and signal lines. The second indicator determines the moment when a position is opened when the lines cross or touch each other. An entry signal is generated at bar close if the following 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 determination method Input unit Stop loss_= 1000 ; // Stop loss points Input unit Profit_= 2000 ; // Profit in points Input string must trade = "Trade Permit" ; //+============== Trade Permit==============+ Input integer deviation_= 10 ; // Maximum limit. Price deviation (in points) Input boolean BuyPosOpen= True ; // Allow entry into long position Enter boolean SELL OPEN = TRUE ; // Allow entering short positions //+------------------------------------------------+ //|Input parameters for filtering indicators | //+------------------------------------------------+ input string filter = "slow trend parameter" ; //+============== trend parameter==============+ Input ENUM_TIMEFRAMES time range = PERIOD_H6 ; // 1 trend chart period Input unit length = 10 ; // Indicator smoothing rate Input unit signal field = 1 ; // Number of bars to receive entry signals Input boolean buy close = true ; // Allow exiting long positions on trend Enter a Boolean value Sell Deal Close = True ; // Allow exiting 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 unit length_= 10 ; // indicator period Input unit signal field_= 1 ; // Number of bars to receive entry signals Input boolean BuyPosClose_= false ; // Allow exiting long positions via signal Enter boolean SellPosClose_= False ; // Allow short positions to be closed via signal //+------------------------------------------------+
The string variable containing the text in the input parameters code is only used for better visualization of the EA input parameters window.
Indicator Sinewave2_Cloud_HTF These in the EA are only used for more convenient visualization of trends in the strategy tester, and they are inactive in other operating modes.
In order for the generated EA to run correctly, the compiled indicator files Period.ex5 , Sinewave2.ex5 , and Sinewave2_Cloud_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 with brokers that offer the following services during position opening . You can download other versions of this library trading algorithms at.
The EA default input parameters are used in the following tests. Stop Loss and Take Profit were not used in the test.

The test results of GBP/USD in 2016, H8 is the slow trend and M30 is the fast trend entry:

Figure 2. Test result graph
Attachment download
📎 tradealgorithms.mqh (223.62 KB)
📎 sinewave2.mq5 (22.75 KB)
📎sinewave2_cloud_htf.mq5 (20.27 KB)
📎 cycleperiod.mq5 (18.96 KB)
📎 exp_sinewave2_x2.mq5 (18.73 KB)
Source: MQL5 #20953
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •