Weird RSIOnArray Behavior

 

Can someone explain why this print statement would produce different values if I set Size to any Value any bigger than 256? Shouldn't the values be the same for all prints with Size >= 256.  

It is my understanding that iRSIOnArray uses 256 (in this case) values regardless of whether there are more values. I thought maybe I just didn't understand ArraySetAsSeries, but even when setting Buffer to False this weird behavior persists. 


int Size = 256;

double Buffer[];

ArrayResize(Buffer, Size);

ArraySetAsSeries(Buffer, True);

for(int i = 1; i <= Size; i++){

    Buffer[i-1] = iClose(Symbol(), 0, i);

}

Print(iRSIOnArray(Buffer, 256, 5, 0));


Disclaimer: I know I can collect the Close buffer from elsewhere, I am just playing around to get a feel for the iRSIOnArray function. 

Reason: