Skip to main content

Posts

Showing posts from February, 2018

ST GAP BUY SELL

 _SECTION_BEGIN("st gap buy sell"); Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); SetBarsRequired(sbrAll,sbrAll); xx=BarIndex();x=xx;Lx=LastValue(x); rightStrength=Optimize("R_S",Param("R_S",3,1,50,1) ,1,50,1); leftStrength=Optimize("L_S",Param("L_S",3,1,50,1), 1,50,1); function pkID(rightStrength,leftStrength) { pk=H>Ref(HHV(H,leftStrength),-1) AND H>=Ref(HHV(H,rightStrength),rightStrength); return pk; } function trID(rightStrength,leftStrength) { tr=L<Ref(LLV(L,leftStrength),-1) AND L<=Ref(LLV(L,rightStrength),rightStrength); return tr; } pk=pkID(rightStrength,leftStrength); tr=trID(rightStrength,leftStrength); SetChartBkColor(ColorRGB(0,0,0));SetChartOptions(0 ,chartShowDates); SetBarFillColor(IIf(C>O,colorGreen,IIf(C<=O,colorRed,colorLightGrey))); pkHigh1=Ref(ValueWhen(pk,H,1),-(rightStreng...