Hello ,
Here,s how you can get HHV-LLV for selected time periods
below code will give you First session HHV-LLV [ 9:15 TO 9:45 ] timing are adjustable
copy and use for plotting 2nd ,3rd ,4th sessions
Hope this will be useful
//=========================================
_SECTION_BEGIN("1 session");
tn = TimeNum();
marketstart=ParamTime( "Market Start 1","9:15" );
etime1 = ParamTime( "End Time 1 ", "9:45" );
cond1 = (tn >= marketstart AND tn <= etime1) ;
firstBar1 = cond1 ;
firstBar1 = firstBar1- Ref( firstBar1, -1 );
xH1 = ValueWhen( cond1, HighestSince( firstBar1, High ) );
xL1 = ValueWhen( cond1, LowestSince( firstBar1, Low ) );
DH1 = TimeFrameCompress( xH1, inDaily, compressLast );
DL1 = TimeFrameCompress( xL1, inDaily, compressLast );
DH1 = TimeFrameExpand( DH1, inDaily, expandFirst );
DL1 = TimeFrameExpand( DL1, inDaily, expandFirst );
dh1a=IIf( cond1 , DH1, Null );
dl1a=IIf( cond1 , DL1, Null );
dh1b=IIf( tn >= etime1 , DH1, Null );
dl1b=IIf( tn >= etime1 , DL1, Null );
Plot( dh1a, "",colorPaleGreen,styleDashed);
Plot( dl1a, "",colorOrange,styleDashed);
Plot( dh1b, "",colorPaleGreen,styleLine);
Plot( dl1b, "",colorOrange,styleLine);
PlotOHLC(dh1a,dh1a,dl1a,dl1a,"",39,styleCloud|stylenolabel,0,0,0,-5);
_SECTION_END();
Plot(C,"",1,132);
nday = IIf(Day()!=Ref(Day(),-1),1,0);
Plot(nday,"",47,styleHistogram|styleDashed|styleNoLabel|styleOwnScale,0,1);
SetChartOptions( 0, chartShowDates );
strWeekday = StrMid("SunMonTueWedThuFriSat", SelectedValue(DayOfWeek())*3,3);
Title = EncodeColor(colorWhite)+ "_ Sessions : " + Name() + " # " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" _ "+strWeekday +" _ "+ " # " + Date() + EncodeColor(colorLime) + StrFormat("\nO %g, H %g, L %g, C %g, V %g ", O, H, L, C, V )
+ EncodeColor(9) +
"\nMkt Start Time : "+ marketstart +
EncodeColor(13) +
"\n1st Session Ends : "+ etime1+
"\n1st HHV : "+ dh1b+ " # " +"1st LLV : "+ dL1b;
//=======================================