_SECTION_BEGIN("JIMBERG TWIST");
Plot( C, "Close", colorDefault, styleCandle);
Len = Param("Len",30,2,90,1);
Buffer = Param("Buffer",2,0.1,20,0.1)*C/1000;
Mid = (HHV(H,Len)+LLV(L,Len))/2;
BO = Mid + Buffer;
BD = Mid - Buffer;
Buy = Cross(C, BO);
Sell = Cross(BD, C);
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short = Sell;
Cover = Buy;
Plot(BO, "Long Entry", colorBlue, styleThick | styleDashed);
Plot(BD, "Short Entry", colorRed, styleThick | styleDashed);
Plot(2, "", IIf(BarsSince(Buy) < BarsSince(Sell), colorBlue, colorRed), styleArea | styleOwnScale | styleNoLabel, -3, 100 );
PlotShapes(Buy * shapeUpArrow, colorGreen,0,L);
PlotShapes(Sell * shapeDownArrow, colorLime,0,H);
_SECTION_END();