Indicators Used
Relative strength index
Miscellaneous
It issuies visual alerts to the screen
0 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

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---