The built-in RSI function accepts open, close, high, low, etc., and combinations therein, as "sources" for the function. Is there a way to pass something a little "less uniform" as the source for the RSI function to operate on?... specifcially, I would like to pass (as "source" for the RSI function) an array of, say, 20 values, where that array is built up of the "low" of the current bar and the "close" of the prior 19 bars.
In simple terms, I would think some kind of code like this would work (but it crashes).
// First define an array of 20 positions
var MyArray = new Array(20);
// Fill positions 0 through -19 with "close" values
MyArray = close (0,-19);
// Over-write position "0" with the "Low" value of the current bar
MyArray(0) = low(0);
// Now pass MyArraw as "source" to the RSI function, so that can be plotted.
MyRSI = new RSIStudy(Length, MyArray);
In simple terms, I would think some kind of code like this would work (but it crashes).
// First define an array of 20 positions
var MyArray = new Array(20);
// Fill positions 0 through -19 with "close" values
MyArray = close (0,-19);
// Over-write position "0" with the "Low" value of the current bar
MyArray(0) = low(0);
// Now pass MyArraw as "source" to the RSI function, so that can be plotted.
MyRSI = new RSIStudy(Length, MyArray);
Comment