// Downloaded From https://www.WiseStockTrader.com SetBarsRequired(1000000, 1000000); SetChartOptions(2,chartShowArrows|chartShowDates); SetTradeDelays(0,0,0,0); P = 12; q = 41; a = 88; period= 4; mult = 1.4; x = 1250; ApplyStop( 2, 2, x, 0, False, 0); showPrice = ParamToggle("Show Price","No|yes",1); showArrows = ParamToggle("Show Arrows","No|yes",1); showRibbon = ParamToggle("Show Ribbon","No|yes",1); f=ATR(period); VS[0] = Close[0]; trend[0] = 0; HighC[0]=0; Lowc[0]=0; for( i = period+1; i < BarCount; i++ ) { vs[i] = vs[i-1]; trend[i] = trend[i-1]; highC[i] = HighC[i-1]; lowc[i] = lowc[i-1]; if ((trend[i]>=0) && ( C[i] VS[i])) { trend[i]=1; HighC[i] = C[i]; lowc[i] = C[i]; } if (trend[i]==-1) { if (C[i]HighC[i]) HighC[i] = C[i]; VS[i]= HighC[i]-(mult*f[i]); } } Buy=Cross(Trend,0) AND StochK(P,3)>q AND Ref(StochK(P,3),-1)<=q AND Ref(StochK(P,3),-1)StochD(P,3,3); Sell= Cross(StochD(P,3,3),StochK(P,3)) AND StochK(P,3)>a; Short = Cross(0, Trend) AND StochK(P,3)=a AND Ref(StochK(P,3),-1)>StochK(P,3) AND StochK(P,3)