Download MetaTrader 5

Convert the indicator RSI BB v1.01, in code to METATRADER 4 to code of ProRealTime

To add comments, please log in or register
Jose Freitas
19
Jose Freitas  

Good Morning,
Can someone help me convert the indicator RSI BB v1.01, whose code METATRADER 4 is described below in code to ProRealTime ?.
Thank you for your attention and please help me.
I need this indicator ProRealTime
Regards,
José Freitas


The Code of RSI BB v1.01

//------------------------------------------------------------------
//
//------------------------------------------------------------------

#property indicator_separate_window
#property indicator_minimum 5
#property indicator_maximum 95

#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 HotPink//SlateBlue
#property indicator_color3 HotPink
#property indicator_color4 White //DarkGray
#property indicator_width1 2
#property indicator_style4 STYLE_DOT
#property indicator_level1 50
#property indicator_level2 30
#property indicator_level3 70
#property indicator_levelcolor Magenta
#property indicator_levelstyle 2

extern int    RSIPeriod     = 14;
extern int    BandPeriod    = 20;
extern double BandDeviation = 1.3185;

double RSIBuf[],UpZone[],DnZone[],Ma[];

//------------------------------------------------------------------
//
//------------------------------------------------------------------

int init()
{
   SetIndexBuffer(0,RSIBuf);
   SetIndexBuffer(1,UpZone);
   SetIndexBuffer(2,DnZone);
   SetIndexBuffer(3,Ma);
   return(0);
}
int deinit() { return(0); }

//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//

int start()
{
   int counted_bars=IndicatorCounted();
      if(counted_bars < 0) return(-1);
      if(counted_bars>0) counted_bars--;
         int limit = MathMin(Bars-counted_bars,Bars-1);
  
   for(int i=limit; i>=0; i--) RSIBuf[i] = iRSI(NULL,0,RSIPeriod,PRICE_WEIGHTED,i);
   for(    i=limit; i>=0; i--)
   {
      double dev = iStdDevOnArray(RSIBuf,0,BandPeriod,0,MODE_SMA,i);
         Ma[i]     = iMAOnArray(RSIBuf,0,BandPeriod,0,MODE_SMA,i);
         UpZone[i] = Ma[i] + BandDeviation * dev;
         DnZone[i] = Ma[i] - BandDeviation * dev; 
   }
   return(0);
}



|
delete
|
 
Convert code METATRADER 4 of indicator RSI BB v1.01 to code PROREALTIME. - MQL4 forum
  • www.mql5.com
Convert code METATRADER 4 of indicator RSI BB v1.01 to code PROREALTIME. - MQL4 forum
To add comments, please log in or register