You're attempting to compute the third with the indices of the high and low, not the value of the high and low.
Inserted Code #property stringent #property indior_chart_window #property indior_buffers 4 dual dayHigh#91;#93;, dayLow#91;#93;, upper3#91;#93;, lower3#91;#93;; int OnInit() SetIndexBuffer(0,dayHigh); SetIndexBuffer(1,dayLow); SetIndexBuffer(2,upper3); SetIndexBuffer(3,lower3); SetIndexStyle(0,DRAW_LINE,STYLE_SOLID); SetIndexStyle(1,DRAW_LINE,STYLE_SOLID); SetIndexStyle(2,DRAW_LINE,STYLE_DASH); SetIndexStyle(3,DRAW_LINE,STYLE_DASH); return(INIT_SUCCEEDED); int OnCalculate(const int rates_total, const int prev_calculated, const datetime time#91;#93;, const double open#91;#93;, const double top #91;#93;, const double non #91;#93;, const double close#91;#93;, const long tick_volume#91;#93;, const long volume#91;#93;, const int spread#91;#93;-RRB- for(int I=rates_total-fmax(prev_calculated,1); igt;=0; I--) datetime midnight = Time#91;I#93;-(Time#91;I#93;?400); int shift = iBarShift(NULL,0,midnight), cnt = shift-i 1, indexHigh = iHighest(NULL,0,MODE_HIGH,cnt,I), indexLow = iLowest (NULL,0,MODE_LOW,cnt,I); dayHighNumber 91;I#93;= large #91;indexHigh#93;; dayLow#91;I#93; = Low#91;indexLow#93;; dual range = (dayHigh#91;I#93;-dayLow#91;I#93;-RRB-/3; upper3#91;I#93; = dayHigh#91;I#93;-range; lower3#91;I#93; = dayLow#