I tried to do this by copying the daily closing bars to my own DataSeries with DataSeries[1] = yesterdays Close DataSeries[2]=close before yesterday's etc and then make DataSeries [0] equal to the current close. I then used RSI() on my DataSeries.
Here is some code to illustrate the problem that I ran into. It just copies the daily closes to another DataSeries and then uses RSI on that DataSeries.
for(int i=0;i<255;i++) { // BarsArray[1] contains the daily bars DailyClosesWithIncomplete.Set(i,BarsArray[1][i]); // These print statements verify that both contain the same values as they are supposed // to do Print("BarsArray[1]["+i+"]=" + BarsArray[1][i]); Print("DailyClosesWithIncomplete["+i+"]=" + DailyClosesWithIncomplete[i]); } //Plot0.Set(RSI(BarsArray[1],14,3)[0]); Plot0.Set(RSI(DailyClosesWithIncomplete,14,3)[0]);
That was not the case, here are the screenshots:
RSI of BarsArray[1]
RSI of DailyClosesWithIncomplete
So, what gives? Is there another way of doing what I am trying to accomplish which avoids this problem?
Comment