Click Image To Enlarge. Please Rate And Comment.
_SECTION_BEGIN("Shiree count back");
// User defined parameters.
GraphXSpace = 10; //defines how much extra space should be added above and below graph line (in percent).
PH= ValueWhen((Ref(H,-2) > Ref(H, -4)) AND (Ref(H,-2) > Ref(H, -3)) AND (Ref(H,-2) > Ref(H, -1)) AND (Ref(H,-2) > H), Ref(H,-2));
PL= ValueWhen((Ref(L,-2) <= Ref(L, -4))AND (Ref(L,-2) <= Ref(L, -3))AND (Ref(L,-2) <= Ref(L, -1)) AND
(Ref(L,-2) <= L), Ref(L,-2));
Plot(Ref(PH,2), "UpPivot", ParamColor("UpPivot Color",colorRed), styleDashed);
Plot(Ref(PL,2), "DownPivot",ParamColor("DownPivot Color",colorGreen), styleDashed);
Buy = C> PH;
Sell = C< PL;
Buy = ExRem(Buy,Sell);
Sell= ExRem(Sell,Buy);
Short = Sell;
Cover = Buy;
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ),0, IIf( Buy, Low, High ) );
_SECTION_END();