mt4_PF_RSL_30m

mt4_PF_RSL_30m
Price Data Components
Series array that contains close prices for each bar
0 Views
0 Downloads
0 Favorites
mt4_PF_RSL_30m
//--------------------------------------------------------------------
// RSL 30M
// Multi Timeframe RSL Tests
//--------------------------------------------------------------------
#property indicator_separate_window    // Indicator is drawn in the main window
#property indicator_buffers 1         // Number of buffers
#property indicator_color1 Orange      // Buf_1 RSL Indikator


extern int Aver_Bars=26;               // number of bars for calculation

 
double Buf_0[];             // Declaring indicator arrays

//--------------------------------------------------------------------
int init()                          // Special function init()
  {
//--------------------------------------------------------------------
   SetIndexBuffer(0,Buf_0);         // Assigning an array to a buffer
   SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,1);// Line style
//--------------------------------------------------------------------

  }

int start()
  {
   int i,counted_bars=IndicatorCounted(),n=0;
   double RSL_GD=0;

//----
   if(Bars<=Aver_Bars) return(0);
//---- initial zero
   if(counted_bars<1)
      for(i=1;i<=Aver_Bars;i++) Buf_0[Bars-i]=0.0;
//----
   i=Bars-Aver_Bars-1;
   if(counted_bars>=Aver_Bars) i=Bars-counted_bars-1;
   while(i>=0)
     {
      RSL_GD=0;
      
      
      for(n=0;n<Aver_Bars;n++)
         {
         RSL_GD=(RSL_GD+(iClose(Symbol(),PERIOD_M30,(i+n))));
         }
         

 
 //RSL zeichnen-START-------------------------------------------------------------   
      Buf_0[i]=(iClose(Symbol(),PERIOD_M30,i)/((RSL_GD)/Aver_Bars));
 //-------------------------------------------------------------------------------  


          i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+

Comments