Min_Max_RSI

Author: Copyright � 2007, 4/Mar/2007 David W Honeywell
Min_Max_RSI
Indicators Used
Relative strength index
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
Min_Max_RSI
//+------------------------------------------------------------------+
//|                                                  Min_Max_RSI.mq4 |
//|                   Copyright © 2007, 4/Mar/2007 David W Honeywell |
//|                                     hellonwheels.trans@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, 4/Mar/2007 David W Honeywell"
#property link      "hellonwheels.trans@gmail.com"

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100

#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red

extern int RsiPeriods = 14,ShowBars = 500;

double Hrsi;
double Lrsi;

double TopArrow[];
double BottomArrow[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

int init()
  {
//---- indicators
   
   SetIndexStyle(0,DRAW_LINE);
   SetIndexEmptyValue(0,0.0);
   SetIndexBuffer(0,TopArrow);
   
   SetIndexStyle(1,DRAW_LINE);
   SetIndexEmptyValue(1,0.0);
   SetIndexBuffer(1,BottomArrow);
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   
   for ( int shift = ShowBars; shift > 0; shift-- )
    {
     if (iRSI(Symbol(),0,RsiPeriods,PRICE_CLOSE,shift) <= 50.0000) { Hrsi = 50.0000; }
     if (iRSI(Symbol(),0,RsiPeriods,PRICE_CLOSE,shift) > 50.0000 && iRSI(Symbol(),0,RsiPeriods,PRICE_CLOSE,shift) >= Hrsi) { Hrsi = iRSI(Symbol(),0,RsiPeriods,PRICE_CLOSE,shift); }
     if (iRSI(Symbol(),0,RsiPeriods,PRICE_CLOSE,shift) >= 50.0000) { Lrsi = 50.0000; }
     if (iRSI(Symbol(),0,RsiPeriods,PRICE_CLOSE,shift) < 50.0000 && iRSI(Symbol(),0,RsiPeriods,PRICE_CLOSE,shift) <= Lrsi) { Lrsi = iRSI(Symbol(),0,RsiPeriods,PRICE_CLOSE,shift); }
    
     TopArrow[shift]    = Hrsi;
     BottomArrow[shift] = Lrsi;
    }
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

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 ---