Applying iRSIOnArray() on custom time-series [mql4]

 

Dear all,

I'm struggling with a presumably simple task: My custom indicator calculates and plots an indicator line in a window below the chart. Of course, this involves the use of buffers etc. This works as intended. However, now I want to apply the iRSIOnArray() to this custom time-series,that is stored inside the buffer. However, I'm just not getting it to plot or even display values via Comment(). I have my programming background mostly in python and I'm sure I'm missing something in the data-handling. Any help would be very much appreciated! :)


#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 clrBlack
#property indicator_color2 clrBlack
//#property indicator_minimum    -2
//#property indicator_maximum    2
#property indicator_level1     0
#property indicator_level2     1
#property indicator_level3     -1
#property indicator_level4     2
#property indicator_level5     -2
#property indicator_levelcolor clrBlack
#property indicator_levelstyle STYLE_SOLID
extern int       barsToProcess=100;
double ExtMapBuffer1[1000];
double indc[1000];
double result;

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {

   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   ArrayInitialize(indc,0);
   return(0);
  }

int deinit()
  {

   return(0);
  }

int start()
  {
   int counted_bars=IndicatorCounted();

   for(int i=0; i<Bars; i++)
     {


      //Some calculation here, returns result

     
      ExtMapBuffer1[i]=result;   //works and plots properly
      //ArraySetAsSeries(ExtMapBuffer1,true);
      indc[i]=iRSIOnArray(ExtMapBuffer1,0,14,0);  //does not work. Problem with buffer/array/dtyp
     }
   
   return(0);
  }
//+------------------------------------------------------------------+
 

Create a buffer for the RSI OnArray.

Fill the first buffer BEFORE trying to do the  RSI OnArray.


Topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.

Reason: