input length = 5;
def Close0 = close[0];
def Close1 = close[1];
def Close2 = close[2];
def Close3 = close[3];
def Close4 = close[4];
def Close5 = close[5];
def Close6 = close[6];
def Close7 = close[7];
def inc0 = Close0 - Close1;
def inc1 = Close1 - Close2;
def inc2 = Close2 - Close3;
def inc3 = Close3 - Close4;
def inc4 = Close4 - Close5;
def inc5 = Close5 - Close6;
def inc6 = Close6 - Close7;
def High1 = if inc1 > inc2 then High1 == inc1 else High1 == inc2;
plot UpperLevel = High1;
def Close0 = close[0];
def Close1 = close[1];
def Close2 = close[2];
def Close3 = close[3];
def Close4 = close[4];
def Close5 = close[5];
def Close6 = close[6];
def Close7 = close[7];
def inc0 = Close0 - Close1;
def inc1 = Close1 - Close2;
def inc2 = Close2 - Close3;
def inc3 = Close3 - Close4;
def inc4 = Close4 - Close5;
def inc5 = Close5 - Close6;
def inc6 = Close6 - Close7;
def High1 = if inc1 > inc2 then High1 == inc1 else High1 == inc2;
plot UpperLevel = High1;