Previous Day High/Low/Middle indie for an indie - help needed

 

Hi! I had this pivot indicator that I changed to showing simply yesterday's High, Low and 50% instead of pivot points.

Now I want to apply this indicator to an indicator in a separate window, say RSI. My understanding is that all I need is to change these lines

         

PDayHigh = Close[ iHighest( NULL, 0, MODE_HIGH, Count, i+1 ) ]; // Pivot Day high
PDayLow = Close[ iLowest( NULL, 0, MODE_LOW, Count, i+1 ) ]; // Pivot Day low

so that it would find Min and Max for the RSI instead of price. How do I do this? I guess, I need to apply MathMin and MathMax to an array of RSI values... But I do not yet understand much about the workings of anything that has those square brackets []

Please help!

Reason: