Waddah Attar Def RSI

Waddah Attar Def RSI
0 Views
0 Downloads
0 Favorites
Waddah Attar Def RSI
//+------------------------------------------------------------------+
//|                                         Waddah_Attar_Def_RSI.mq4 |
//|                              Copyright © 2007, Eng. Waddah Attar |
//|                                          waddahattar@hotmail.com |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2007, Eng. Waddah Attar"
#property  link      "waddahattar@hotmail.com"
//----
#property  indicator_separate_window
#property  indicator_buffers 2
#property  indicator_color1  Green
#property  indicator_color2  Red
#property  indicator_width1  2
#property  indicator_width2  2
//----
extern int RSIPeriod1=14;
extern int RSIPeriod2=28;

double   ind_buffer1[];
double   MABuffer1[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
   SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);
//----   
   SetIndexBuffer(0, ind_buffer1);
   SetIndexBuffer(1, MABuffer1);
//----   
   IndicatorShortName("Waddah Attar Def RSI");
   Comment("copyright waddahwttar@hotmail.com");
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   Comment("");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   double RSI1,RSI2,Explo;

   int  limit, i, counted_bars = IndicatorCounted();
//----
   if(counted_bars < 0) 
       return(-1);
//----
   if(counted_bars > 0) 
       counted_bars--;
   limit = Bars - counted_bars;
//----
   for(i = limit - 1; i >= 0; i--)
   {
     RSI1 = iRSI(NULL, 0, RSIPeriod1, PRICE_CLOSE, i);
     RSI2 = iRSI(NULL, 0, RSIPeriod2, PRICE_CLOSE, i);

     MABuffer1[i] = (RSI1-RSI2);
   }

   for(i = 0; i < Bars; i++)
   {
     ind_buffer1[i] = iMAOnArray(MABuffer1,0,14,0,MODE_SMA,i);
   }

   for(i = 0; i < Bars; i++)
   {
     MABuffer1[i]=0;
   }

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