HI everyone so Im wondering if its possible to auto plot the High and Low of a range within a certain time period as well as the highest body close or open and lowest body close or open. I have already done the High and Low of the range ( Which is 9:30 to 10:30) But im trying to figure how to plot the highest body close (green line) and the lowest body close (Red Line). Below will be the script I have so far and any help would be greatly appreciated.
https%3A//i.imgur.com/jEifYPF.png[/img]']
Code:
############################# Inputs #############################
def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def Buying = if H == L then V else Round (V * (C - L) / (H - L), 0);
def Selling = if H == L then V else Round (V * (H - C) / (H - L), 0);
def na=double.nan;
input ORBegin = 0930;
input OREnd = 1031;
#
input ShowTodayOnly={"No", default "Yes"};
def s=ShowTodayOnly;
#
Def ORActive = if secondstilltime(OREnd)>0 AND secondsfromtime(ORBegin)>=0 then 1 else 0;
def today=if s==0 OR getday()==getlastday() AND secondsfromtime(ORBegin)>=0 then 1 else 0;
Rec ORHigh = if ORHigh[1]==0 or ORActive[1]==0 AND ORActive==1 then high else if ORActive AND high>ORHigh[1] then high else ORHigh[1];
Rec ORLow = if ORLow[1]==0 or ORActive[1]==0 AND ORActive==1 then low else if ORActive AND low<ORLow[1] then low else ORLow[1];
#
Def ORWidth = ORHigh - ORLow;
Def fib_mid = (ORHigh+ORLow)/2;
#
Plot ORH=if ORActive OR today<1 then na else ORHigh;
Plot ORL=if ORActive OR today<1 then na else ORLow;
Plot FibMid=if ORActive OR today<1 then na else fib_mid;
#
ORH.setdefaultcolor(color.blue);
ORH.setpaintingStrategy(PaintingStrategy.line);
ORH.setlineweight(3);
ORL.setdefaultcolor(color.plum);
ORL.setpaintingStrategy(PaintingStrategy.line);
ORL.setlineweight(3);
FibMid.setdefaultcolor(color.gray);
FibMid.setpaintingStrategy(PaintingStrategy.line);
FibMid.setlineweight(3);
#
https%3A//i.imgur.com/jEifYPF.png[/img]']