// Downloaded From https://www.WiseStockTrader.com _SECTION_BEGIN("Price"); 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 ) ) )); _SECTION_END(); SetChartOptions(0, chartShowDates | chartWrapTitle); GfxTextOut("5 Candle Calculation", 43, 60); E5 = EMA(Close, 5); E34 = EMA(Close, 34); BTrig = Cross(E5, E34); STrig = Cross(E34, E5); BT = Flip(BTrig, STrig); ST = Flip(STrig, BTrig); B_High = ValueWhen(Btrig,(H + (H*.001)), 1); S_Low = ValueWhen(STrig, (L - (L*.001)), 1); BuyPrice=ValueWhen(Btrig, (H + .001), 1); SellPrice=ValueWhen(STrig, (L -.001), 1); Buytarget = (BuyPrice*2)-Ref(L, -5); Buysl=Ref(L,-5); Selltarget= (SellPrice*2)-(Ref(H, -5)); Sellsl=Ref(H, -5); Buy = BT AND H > B_High; Sell= Buytarget OR Buysl; Filter = Buy OR Sell; Short = ST AND L < S_Low; Cover=Selltarget OR Sellsl; //if(Buy=1) //{ GfxTextOut("Buy@-- " + ( WriteVal(B_High) ), 43, 100 ); GfxTextOut("Target-- " + ( WriteVal(Buytarget) ), 40, 120 ); GfxTextOut("Sl--" + ( WriteVal(Buysl) ), 40, 140 ); //} //if(Sell=1) //{ GfxTextOut("Sell@-- " + ( WriteVal(S_Low ) ), 43, 180 ); GfxTextOut("Target-- " + ( WriteVal(Selltarget) ), 40, 200 ); GfxTextOut("Sl--" + ( WriteVal(Sellsl) ), 40, 220 ); //} Buy = ExRem(Buy, Sell); Sell = ExRem(Sell, Buy); Short=ExRem(Short,Cover); Cover=ExRem(Cover,Short); _N(Title = StrFormat("{{NAME}} ({{INTERVAL}}), {{DATE}} : {{OHLCX}}, Vol=%1.0f\n{{VALUES}}", V)); COL1=IIf(EMA(Close,5)>EMA(Close,34) AND Low > EMA(Close,34),colorBlue,IIf(EMA(Close,5)