/**********************************************************************************
**************************Start of Vijay Pivot Breakout System***************************
First Version.
**********************************************************************************/
_SECTION_BEGIN("Trading System - Parameters");
pivotoff = ParamToggle("Pivot Off","No|Yes",0);
if (pivotoff == 0) {
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", colorWhite, styleNoTitle | styleCandle);
SV_LP=Param("Lookback Period for pivot?",4,2,50,1);
PH = H > Ref(HHV(H,SV_LP),-1) AND Ref(HHV(H,SV_LP),SV_LP)<=H;
PHP = ValueWhen(PH,H);
PL = L < Ref(LLV(L,SV_LP),-1) AND Ref(LLV(L,SV_LP),SV_LP)>=L;
if(ParamToggle("Suppress Successive Same Pivots?","No,Yes")){
PH = ExRem(PH,PL);
PL = ExRem(PL,PH);
}
if(ParamToggle("Plot Pivots?","No,Yes",1)){
PlotShapes(IIf(PH,shapeSmallCircle,shapeNone),colorGreen,0,H,12);
PlotShapes(IIf(PL,shapeSmallCircle,shapeNone),colorRed,0,L,-12);
}
}
_SECTION_END();
/*************************End of Pivot Breakout System***************************/
_N(Title = StrFormat(EncodeColor( colorPaleGreen ) + "{{NAME}} - {{INTERVAL}} {{DATE}} " + " Open %g," + " Hi %g, "
+ " Lo %g, " + " C %g {{VALUES}}", O, H, L, C )
+EncodeColor( colorRed ) + "\n"+", LH = " + NumToStr(Ref(H,-1), 1.4) + ", LL = "
+ NumToStr(Ref(L,-1), 1.4) + ", LH2 = " + NumToStr(Ref(H,-2), 1.4) + ", LL2 = " + NumToStr(Ref(L,-2), 1.4));