Cature RSI Value

 
Been trying to capture RSI value (which should be between 0 and 100) but iRSI does seem to provide that.  Am I missing something?
 
wheres the code
 
Marco vd Heijden:
wheres the code

Code is below and I am struggling with how to capture the value of RSI so I can build an array...


input int RSIperiod=14; // Period for calculating the RSI. At least that's what the book says

RSIHandle=iRSI(NULL,0,RSIperiod,PRICE_CLOSE);


   CopyBuffer(RSIHandle, "What wold go here?",0,17,RSI_ARRAY);
   ArraySetAsSeries(RSI_ARRAY,true);

 
 int       buffer_num,           // indicator buffer number
 

Okkk?  So I would do something like....


RSIHandle=iRSI(NULL,0,RSIperiod,PRICE_CLOSE);

int buffer_num;

buffer_num=RSIHandle;

CopyBuffer(RSIHandle,buffer_num,0,17,RSI_ARRAY);

ArraySetAsSeries(RSI_ARRAY,true);

 

try 0

i assume you only have one buffer....

 
Marco vd Heijden:

try 0

i assume you only have one buffer....

I have multiple buffers. one for MACD, one for EMA, and one for RSI. I'm attempting to do comparisons on the three arrays copied into these buffers depending on the value of SMA.  But I'm not quire sure what you mean by try '0'.
 
flwilliams87:
I have multiple buffers. one for MACD, one for EMA, and one for RSI. I'm attempting to do comparisons on the three arrays copied into these buffers depending on the value of SMA.  But I'm not quire sure what you mean by try '0'.

RSI has only 1 buffer, the buffer index always start at 0. So you have to use 0 as second parameter for CopyBuffer.

For EMA, there is always 1 buffer only, so it will be 0 too.

MACD has 2 buffers, main is 0 and signal is 1.

Etc...please read the documentation.