/***********************************************************************************
Coder - rmike
Code For - Traderji Members
Permissions - This is permitted to be distibuted freely in its entirety with no
modifications and acknowledgement to original coder
Disclaimer - The provision of the code does not constitute trading/ investment advice.
The code is meant for educational purposes only
************************************************************************************/
_SECTION_BEGIN("Last HL");
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", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
ext = Param("Extend", 5, 1, 15, 1);
PH = LastValue(Ref(H, -1));
PL = LastValue(Ref(L, -1));
hx0 = LastValue(BarCount -(ext + 2));
hx1 = BarCount - 1;
Line1 = LineArray( hx0, PH, hx1, PH, 1);
lx0 = LastValue(BarCount - (ext + 2));
lx1 = BarCount - 1;
Line2 = LineArray( lx0, PL, lx1, PL, 1);
Plot( Line1, "H", ParamColor("LB1 High Color", colorGreen), styleLine, Null, Null, ext);
Plot( Line2, "L", ParamColor("LB2 High Color", colorPink), styleLine, Null, Null, ext);
_SECTION_END();