_SECTION_BEGIN("Selected TF Bar High Low Markings");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
tf = Param("Select Time frame (min)",30,1,1440,1);
tfrm=in1Minute*tf;
TimeFrameSet(tfrm);
H1 = Ref(H,-1);
L1 = Ref(L,-1);
TimeFrameRestore();
H1 = TimeFrameExpand(H1, tfrm,expandFirst);
L1 = TimeFrameExpand(L1, tfrm,expandFirst);
LastbarH = H1 != Ref(H1,1);//Edit: if "-1" then the dots on first TF bar; if "1" then dots on last TF bar
LastbarL = L1 != Ref(L1,1);//Edit: if "-1" then the dots on first TF bar; if "1" then dots on last TF bar
//Use these plots for uncluttered chart with less prominent dashed lines
//Plot(iif(LastbarH,Null,H1),"",colordarkyellow,styledashed|stylenorescale); //uncomment this line if you want not so prominent dashed lines, you can also change color of line
//Plot(iif(LastbarL,Null,L1),"",colorgreen,styledashed|stylenorescale);//uncomment this line if you want not so prominent dashed lines, you can also change color of line
//In case the below is confusing then use the above plots
Plot(IIf(LastbarH,H1,Null),"",colororange,styledots|stylenoline|stylenorescale);//this will plot single dot at the end of last 30m bar on your TF chart
Plot(IIf(LastbarL,L1,Null),"",colorbrightgreen,styledots|stylenoline|stylenorescale);//this will plot single dot at the end of last 30m bar on your TF chart
_SECTION_END();