_SECTION_BEGIN("Initial Range HI-LO");
IRHL = ParamToggle("InitialRange HI LO","Show|Hide",1);
DayC = TimeFrameGetPrice("C", inDaily, -1); DayCI = LastValue (DayC,1); // yesterdays close
DayO = TimeFrameGetPrice("O", inDaily); DayOI = LastValue (DayO,1); // current day open
beginTradeTime = ParamTime("Strt Time ", "9:15:00");
endRangeTime = ParamTime("Range Time","9:30:00");
DaysBack = 0;
IRHigh = Max(deTimeRangeHHV(H,beginTradeTime ,endRangeTime ),deTimeRangeHHV(H,beginTradeTime ,endRangeTime ));
IRLow = Min(deTimeRangeLLV(L,beginTradeTime ,endRangeTime),deTimeRangeLLV(L,beginTradeTime ,endRangeTime ));
RGH = ValueWhen(deFlagLastBarOfDay(endRangeTime ),IRHigh ,DaysBack);
RGL = ValueWhen(deFlagLastBarOfDay(endRangeTime ), IRLow ,DaysBack);
RH = IRHigh; RHI = LastValue (DH,1);// 15 Min high
RL = IRLow; RLI = LastValue (DL,1); // 15 Min low
Today = LastValue(Day());
numbars = LastValue(Cum(Status("barvisible")));
Hts = -33.5;
Today = LastValue(DaysSince1900());
if(IRHL==1) {
// Plot(IIf(Today==DaysSince1900(),RL,Null),"RL",RGClrs,styleLine|styleThick|styleNoRescale|styleNoTitle|styleNoLabel,0,0,0,BarLayer+1);
// Plot(IIf(Today==DaysSince1900(),RH,Null),"RH",RGClrs,styleLine|styleThick|styleNoRescale|styleNoTitle|styleNoLabel,0,0,0,BarLayer+1);
// Plot(IIf(Today==Day(),RGL,Null),"RL",RGClrs,styleLine|styleThick|styleNoRescale|styleNoTitle|styleNoLabel,0,0,0,BarLayer+1);
// Plot(IIf(Today==Day(),RGH,Null),"RH",RGClrs,styleLine|styleThick|styleNoRescale|styleNoTitle|styleNoLabel,0,0,0,BarLayer+1);
Plot(RL,"RL",RGClrs,styleLine|styleThick|styleNoRescale|styleNoTitle|styleNoLabel,0,0,0,BarLayer+1);
Plot(RH,"RH",RGClrs,styleLine|styleThick|styleNoRescale|styleNoTitle|styleNoLabel,0,0,0,BarLayer+1);
}