_SECTION_BEGIN("Price");
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() );
TimeFrameSet(in1Minute*30);
HTFMA = MA(Close,200);
HTFUP = Close > HTFMA;
HTFDN = Close < HTFMA;
TimeFrameRestore();
HTF_MA = TimeFrameExpand(HTFMA,in1Minute*30);
HTF_UP = TimeFrameExpand(HTFUP,in1Minute*30);
HTF_DN = TimeFrameExpand(HTFDN,in1Minute*30);
MA200 = MA(Close,200);
Buy = Close > MA200 AND HTF_UP;
Sell = Close < MA200;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short = Close < MA200 AND HTF_DN;
Cover = Close > MA200;
Short = ExRem(Short,Cover);
Cover = ExRem(Cover,Short);
SetPositionSize(1,4);
Plot(HTF_MA,"30MIN_MA200",IIf(HTF_UP,colorBlue,colorRed),styleThick);
Plot(MA200,"MA200",IIf(C>MA200, colorBlue,colorRed),styleLine);
PlotShapes(Buy+2*Short,colorWhite,0,IIf(Buy,L,H));
PlotShapes(Cover*3+4*Sell,colorWhite,0,IIf(Cover,L,H));
_SECTION_END();