Indicators Used
Relative strength index
Miscellaneous
It issuies visual alerts to the screen
3 Views
0 Downloads
0 Favorites
RSI Alert
ÿþ#property copyright "Copyright © 2021, http://cmillion.ru"

#property link      "cmillion@narod.ru"

#property description "Relative Strength Index Alert"

#property strict



#property indicator_chart_window

input int InpRSIPeriod=14; // RSI Period

input int SetUp=70; // RSI Signal UP

input int SetDn=30; // RSI Signal DN

int trigger=0;

//+------------------------------------------------------------------+

int OnInit(void)

  {

   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| Relative Strength Index                                          |

//+------------------------------------------------------------------+

int OnCalculate(const int rates_total,

                const int prev_calculated,

                const datetime &time[],

                const double &open[],

                const double &high[],

                const double &low[],

                const double &close[],

                const long &tick_volume[],

                const long &volume[],

                const int &spread[])

  {

  double RSI = iRSI(Symbol(),0,InpRSIPeriod,PRICE_WEIGHTED,0);



   if (trigger< 1 && RSI>=SetUp) {trigger= 1; Alert(Symbol()," RSI = ", DoubleToString(RSI,4));}

   if (trigger>-1 && RSI<=SetDn) {trigger=-1; Alert(Symbol()," RSI = ", DoubleToString(RSI,4));}

//---

   return(rates_total);

  }

//+------------------------------------------------------------------+

Comments