NewDay = Day()!= Ref(Day(), -1);
Period = Min(BarsSince(NewDay),11)+2;
//first bar=0, use +2 to get yesterdays last bar, or +1 to skip last bar
mH = MA(H,Period); mL = MA(L,Period);
Plot(mH,"", colorYellow, styleNoLabel|styleDashed);
Plot(mL,"", colorYellow, styleNoLabel|styleDashed);
PlotOHLC(mL,mH,mL,mH,"", colorLightGrey, styleCloud|styleNoLabel);