RSI Value Problem

 
Good day guys! Anybody help with my problem regarding RSI value. How to get this 58.31 using mql5. and this code
"CopyBuffer(rsiDefinition,0,0,3,rsiArray);" are giving me the price of the current symbol. I want this 58.31 for the signal of less then 30 and more than 70. thanks in advance.

Files:
a.jpg  73 kb
 

Help: https://www.mql5.com/en/docs/series/copybuffer

//+------------------------------------------------------------------+
//| CopyBuffer                                                       |
//|   https://www.mql5.com/en/docs/series/copybuffer                 |
//|int  CopyBuffer(                                                  |
//|   int       indicator_handle,     // indicator handle            |
//|   int       buffer_num,           // indicator buffer number     |
//|   int       start_pos,            // start position              |
//|   int       count,                // amount to copy              |
//|   double    buffer[]              // target array to copy        |
//|);                                                                |
//+------------------------------------------------------------------+

   double rsi[];
   ArraySetAsSeries(rsi,true);

   int buffer_num = 0;  // indicator buffer number
   int start_pos  = 0;  // start position
   int count      = 3;  // amount to copy

   if(CopyBuffer(indicator_handle,buffer_num,start_pos,count,rsi)!=count)
      return;
   Print(DoubleToString(rsi[0],2));
Documentation on MQL5: Timeseries and Indicators Access / CopyBuffer
Documentation on MQL5: Timeseries and Indicators Access / CopyBuffer
  • www.mql5.com
Counting of elements of copied data (indicator buffer with the index buffer_num) from the starting position is performed from the present to the past, i.e., starting position of 0 means the current bar (indicator value for the current bar). When copying the yet unknown amount of data, it is recommended to use a dynamic array as a buffer[]...