rsi_filter
Indicators Used
Relative strength indexMoving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
rsi_filter
//+------------------------------------------------------------------+
//|                                                   RSI_Filter.mq4 |
//+------------------------------------------------------------------+
//|                                                   RSI_Filter.mq4 |
//|                          Copyright 2014, Toptahlil Software Corp |
//|                                      Emial : Toptahlil@yahoo.com |
//+------------------------------------------------------------------+
#property description "feedbacks: https://login.mql5.com/en/users/toptahlil/feedbacks"
#property copyright  "post a job for me: http://www.mql5.com/en/job/new?prefered=toptahlil"
#property link      "Emial : Toptahlil@yahoo.com"
#property description      "Skype ID : Toptahlil"
#property description      "MQL5  ID : Toptahlil"
#property version   "1.0"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red


extern int RSI_Period=34;
extern ENUM_APPLIED_PRICE RSI_ApplyPrice= PRICE_CLOSE;
extern int MA_Period=34;
extern  ENUM_MA_METHOD MA_Method =MODE_SMMA;
extern int MA_Shift=0;
double B1[], B2[], B3[];

//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators

//---- drawing settings
   SetIndexStyle(0, DRAW_LINE);
   SetIndexStyle(1, DRAW_LINE);
   SetIndexBuffer(0,B1);
   SetIndexBuffer(1,B2);
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
//---- indicator short name
   IndicatorShortName("RSI_Filter");
   ArraySetAsSeries(B1,true);
   ArraySetAsSeries(B2,true);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   
   int    pos=Bars-2;
   int i;   
   if(ExtCountedBars>2) pos=Bars-ExtCountedBars-1;
//---- main calculation loop
   for(i=0;i<Bars;i++)
      {
      B1[i] = iRSI(Symbol(),Period(),RSI_Period,RSI_ApplyPrice,i);
      }
   for(i=0;i<Bars;i++)
      {
      
      B2[i]= iMAOnArray(B1,0,MA_Period,MA_Shift,MA_Method,i);
      }  
   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 ---