below script looks at the ratio between 1st bar and last bar and provides a percentage. Can someone help add script so that it goes green with percentage is 40% or less and above 40% be white.
input Start_Bar_Time = 0930;
def Var2 = If secondsFromTime(Start_Bar_Time)==(GetAggregationPeriod()/1000) then high[1] else Var2[1];
def Var3 = If secondsFromTime(Start_Bar_Time)==(GetAggregationPeriod()/1000) then low[1] else Var3[1];
def Var4 = AbsValue(Var2 - Var3);
AddLabel(no,"First Bar High "+Var2+" Low "+Var3+": "+Var4,color.white);
def Var5 = high[1]-low[1];
def Var6 = (Var5/Var4)*100;
# dummy label
AddLabel(1," ",color.black);
AddLabel(yes,"Last Bar / First Bar = "+Round(Var6,1)+"%",color.green);
AddLabel(yes,"High: " + High[1],color.white);
AddLabel(yes,"Low: " + Low[1], color.white);
AddLabel(no,"High - Low: " + (High[1] - Low[1]),color.white);
input Start_Bar_Time = 0930;
def Var2 = If secondsFromTime(Start_Bar_Time)==(GetAggregationPeriod()/1000) then high[1] else Var2[1];
def Var3 = If secondsFromTime(Start_Bar_Time)==(GetAggregationPeriod()/1000) then low[1] else Var3[1];
def Var4 = AbsValue(Var2 - Var3);
AddLabel(no,"First Bar High "+Var2+" Low "+Var3+": "+Var4,color.white);
def Var5 = high[1]-low[1];
def Var6 = (Var5/Var4)*100;
# dummy label
AddLabel(1," ",color.black);
AddLabel(yes,"Last Bar / First Bar = "+Round(Var6,1)+"%",color.green);
AddLabel(yes,"High: " + High[1],color.white);
AddLabel(yes,"Low: " + Low[1], color.white);
AddLabel(no,"High - Low: " + (High[1] - Low[1]),color.white);