RJTX_Matches_Smoothed_Alert - MetaTrader 5 Script - MT4/MT5 Resources





Rafael Jimenez Tocino
The indicator RJTX_Matches_Smoothed has alerts, emails and push notifications for smartphones.
In order to implement alerts, email messages and push notifications, the following changes were made to the indicator code:
Number of input units = 1 ; // Number of bars to activate the signal Input boolean sound on = true ; // Enable alert Input unit alarm number = 2 ; // number of alarms input boolean email-on = false ; // Enable mailing signal input boolean pressed = false ; // Enable signaling to mobile devices
//+------------------------------------------------------------------+ //|Buy signal function | //+------------------------------------------------------------------+ Blank buy signal( string signal sir name, // Indicator name text for emails and push messages double buy arrow(&B)[], // Indicator buffer with buy signal constant integer rate_total, // Current number of bars constant integer ex_calculation, // Number of bars for the previous price move constant double & close [], // Closing price constant integer & spread[]) // spread { //--- stationary unit counter = 0 ; if (Rates_total!=Prev_calculated) counter = 0 ; boolean buysignal = false ; booleanSeriesTest = array getSeries (BuyArrow); integer index, index 1; if (series test) { Index = integer (number of items); index1=index+ 1 ; } other { Index=Rates_total- integer (number of items) -1 ; index1=index- 1 ; } if (!BuyArrow[index1] && BuyArrow[index]) BuySignal= true ; if (BuySignal && counter<=NumberofAlerts) { counter++; MqlDateTimeTM ; BuildTime ( timecurrent (),tm); string literal = string time ( timecurrent (), TIME_DATE ) + "" + string (tm.hour) + ":" + string (tm.minute); SeriesTest = arrayGetSeries ( close ); if (series test) index = integer (number of items); Other indexes=Rates_total- integer (number of items) -1 ; double question = close [index]; double bid = close [index]; SeriesTest = arrayGetSeries (spread); if (series test) index = integer (number of items); Other indexes=Rates_total- integer (number of items) -1 ; bid +=spread[index]* _views ; Thin string question = double to string ( question , _number ); stringbid = double to string ( bid , _number ); String sPeriod=GetStringTimeframe( ChartPeriod ()); if (sound on) alert ( "buy signal\n ask=" , ask , "\n bid=" , bid , "\n current time=" , text, "\n symbol=" , symbol (), "period=" ,s period); if (email) send mail (signal sir name + ": buy signal alert" , "buy signal at inquiry =" + ask + ", bid =" + bid + ", date = " + text + " symbol = " + symbol () + " period = " + s period); ass="keyword">If (push) send notification (Signal Mr. Name + ": Buy signal at Ask=" + Ask + ", Bid =" + Bid + ", Date =" + Text + "Symbol =" + Symbol () + "Period = " +sPeriod); } //--- } //+--------------------------------------------------------------------------------+ // | Sell Signal Function | //+--------------------------------------------------------------------------------+ Blank Sell Signal( string Signal Mr. Name, // Indicator name text for emails and push messages Double sales arrows (&S)[], // indicator buffer with sell signals constant integer rates_total, // current number of bars constant integer prev_calculated, // number of bars of the previous price movement constant double & close [], // closing price constant integer &spread[]) // spread { //--- stationary unit counter = 0 ; if (Rates_total!=Prev_calculated) counter = 0 ; boolean sell signal = false ; boolean series test = array get series (sell arrow); int index, index 1; if (series test) { index = int (number of bars); index 1 = index + 1 ; } else { index = Rates_total - integer (number of bars) - 1 ; index 1 = index - 1 ; } if (!SellArrow[index1] && SellArrow[index]) SellSignal = True ; if (SellSignal && Counter <= NumberofAlerts) { Counter++; MqlDateTimeTM ; BuildTime ( timecurrent (), tm); string literal = String time ( timecurrent (), TIME_DATE ) + "" + string (tm.hour) + ":" + string (tm.minute); Series test = array to get series ( closed ); if (series test) index = integer (number of items); other indexes = Rates_total - integer (number of items) - 1 ; double ask = close [index]; double bid = close [index]; series test = array to get series (propagation); if (series test) index = integer (number of items); other indexes = Rates_total - integer (number of items) - 1 ; bid + = spread [index]* _view ; string ask = Double to String ( ask , _number ); string bid = Double to String ( bid , _number ); string sPeriod = GetStringTimeframe( ChartPeriod ()); if (sound on) alert ( "sell signal\n ask=" , ask , "\n bid=" , bid , "\n current time=" , text, "\n symbol=" , symbol (), "period=" ,s period); ifn>(email) send mail (signal sir name + ": sell signal alert" , "sell signal on ask=" +ask+ ", bid=" +bid+ ", date=" + text + "symbol=" + symbol ()+ "period=" +speriod); if (push) send notification (signal sir name + ": sell signal on ask=" +ask+ ", bid=" +bid+ ", date=" + text + "symbol=" + symbol ()+ " "Period = " +s period); } //--- } //+------------------------------------------------------------------+ //| Get the time range in string form | //+------------------------------------------------------------------+ String gets the string time range ( ENUM_TIMEFRAMES approximate time) { //---- Return ( string substring ( enumeration to string (approximate time), 7 , -1 )); //---- }
//--- Buy signal ( “RJTX_Matches_Smoothed_Alert” ,BuyBuffer,rates_total,prev_calculated,close,spread); Sell signal ( “RJTX_Matches_Smoothed_Alert” ,SellBuffer,rates_total,prev_calculated,close,spread); //---
Where BuyBuffer and SellBuffer are the names of the indicator buffers used to store buy and sell signals. Zero or EMPTY_VALUE as empty value must be added to the indicator buffer.
It is assumed that only one call to the functions BuySignal() and SellSignal() is used in the indicator code in the OnCalculate() block.
The indicator uses classes of the library SmoothAlgorithms.mqh (copied to
The indicator was first implemented in MQL4 and published in the code base on December 23, 2015.

Figure 1. RJTX_Matches_Smoothed_Alert indicator on the chart
Figure 2. Indicator RJTX_Matches_Smoothed_Alert. alarm
Attachment download
📎 SmoothAlgorithms.mqh (130.2 KB)
📎 RJTX_Matches_Smoothed_Alert.mq5 (33.09 KB)
Source: MQL5 #22712
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •