SetFormulaName ("Rolling Pivot");
TimeFrameSet( inDaily );
RollPer = Param("Period", 3, 1, 20, 1);
PHigh = HHV(Ref(H,-1),RollPer);
PLow = LLV(Ref(L,-1),RollPer);
PClose = Ref(C,-1);
RPivot = (PHigh + PLow + Pclose)/3;
TimeFrameRestore();
RPivot = TimeFrameExpand( Rpivot, inDaily );
"PHigh: " + NumToStr( PHigh, 1.2 );
"PLow: " + NumToStr( PLow, 1.2 );
"PClose: " + NumToStr( PClose, 1.2 );
Plot(RPivot,"Rolling Pivot",colorLightGrey);