// Downloaded From https://www.WiseStockTrader.com //PATRICK DOHERTY// GraphXSpace=-2; SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) )); H1=SelectedValue( TimeFrameGetPrice( "H", inDaily, -1 )); L1=SelectedValue(TimeFrameGetPrice( "L", inDaily, -1 )); C1=SelectedValue(TimeFrameGetPrice( "C", inDaily, -1 )); /*PIVOT Calculation*/ p = ( H1+ L1 + C1 )/3; s1 = (2*p)-H1; r1 = (2*p)-L1; s2 = p -(H1 - L1); s3 = S1 - (H1-L1); r2 = p +(H1 - L1); r3 = R1 +(H1-L1); Plot (p,"Pivot",25,styleDots); Plot (r1,"R1",12,1); Plot (r2,"R2",12,1); Plot (r3,"R3",12,1); Plot (s1,"S1",3,1); Plot (s2,"S2",3,1); Plot (s3,"S3",3,1); X=Cross(C,p); Z=Cross(p,C); //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //---- H K CHART GraphXSpace=2; HaClose = (O+H+L+C)/4; HaOpen = AMA( Ref( HaClose, -1 ), 0.8); HaHigh = Max( H, Max( HaClose, HaOpen ) ); HaLow = Min( L, Min( HaClose, HaOpen ) ); xDiff = (HaHigh - Halow) * IIf(StrFind(Name(),"JPY"),100,10000); barcolor = IIf(HaClose >= HaOpen,colorWhite,colorWhite); if( ParamToggle("Plot Heikin-Ashi", "No,Yes", 0 ) ) PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "Heikin Ashi " + Name(), colorWhite, styleCandle ); else Plot( C, "Regular candles " + Name(), colorWhite, styleCandle ); j=Haclose; _SECTION_END(); _SECTION_BEGIN("Trade triangle-traderzone"); TimeFrameSet(in15Minute); HMAA = Param("H-MA1", 2, 1, 200, 1, 10 ); H2 = MA(C, HMAA ); Hc=C; TimeFrameRestore(); Hp=TimeFrameExpand(H2,in15Minute,expandFirst); hc=TimeFrameExpand(hc,in15Minute,expandFirst); //Plot(C,"",IIf(Hc>Hp,colorBrightGreen,colorDarkRed),64); TimeFrameSet(in15Minute); DMAA = Param("D-MA",9, 1, 20, 1, 10 ); DP = MA(C, DMAA ); Dc=C; TimeFrameRestore(); dp=TimeFrameExpand(DP,in15Minute,expandFirst); dc=TimeFrameExpand(Dc,in15Minute,expandFirst); Plot( Hp,"HMA",IIf(hp>dp,colorLime,colorRed),styleLine); Plot(dp ,"DMA",colorWhite,styleLine); Buy=C>dp; Sell=CUp[i-1]) { trend[i]=1; if (trend[i-1] == -1) changeOfTrend = 1; } else if (Close[i]0) { flag=1; } else { flag=0; } if (trend[i]>0 && trend[i-1]<0) { flagh=1; } else { flagh=0; } if (trend[i]>0 && Dn[i]Up[i-1]) { Up[i]=Up[i-1]; } if (flag==1) { Up[i]=(H[i]+L[i])/2+(Factor*iATR[i]);; } if (flagh==1) { Dn[i]=(H[i]+L[i])/2-(Factor*iATR[i]);; } if (trend[i]==1) { TrendUp[i]=Dn[i]; if (changeOfTrend == 1) { TrendUp[i-1] = TrendDown[i-1]; changeOfTrend = 0; } } else if (trend[i]==-1) { TrendDown[i]=Up[i]; if (changeOfTrend == 1) { TrendDown[i-1] = TrendUp[i-1]; changeOfTrend = 0; } } } TrendSL=IIf(trend==1,TrendUp,TrendDown); for(i=BarCount-1;i>1;i--) { if(Buy[i] == 1) { entry = C[i]; sig = "BUY"; sl = TrendSL[i]; tar1 = entry + (entry * .0050); tar2 = entry + (entry * .0099); tar3 = entry + (entry * .0149); tar4 = entry + (entry * .0210); tar5 = entry + (entry * .0269); tar6 = entry + (entry * .0325); bars = i; i = 0; } if(Sell[i] == 1) { sig = "SELL"; entry = C[i]; sl = TrendSL[i]; tar1 = entry - (entry * .0050); tar2 = entry - (entry * .0099); tar3 = entry - (entry * .0149); tar4 = entry - (entry * .0210); tar5 = entry - (entry * .0269); tar6 = entry - (entry * .0325); bars = i; i = 0; } } Offset = 20; Clr = IIf(sig == "BUY", colorLime, colorRed); ssl = IIf(bars == BarCount-1, TrendSL[BarCount-1], Ref(TrendSL, -1)); sl = ssl[BarCount-1]; Plot(LineArray(bars-Offset, tar1, BarCount, tar1,1), "", Clr, styleLine|styleDots, Null, Null, Offset); Plot(LineArray(bars-Offset, tar2, BarCount, tar2,1), "", Clr, styleLine|styleDots, Null, Null, Offset); Plot(LineArray(bars-Offset, tar3, BarCount, tar3,1), "", Clr, styleLine|styleDots, Null, Null, Offset); Plot(LineArray(bars-Offset, tar4, BarCount, tar4,1), "", Clr, styleLine|styleDots, Null, Null, Offset); Plot(LineArray(bars-Offset, tar5, BarCount, tar5,1), "", Clr, styleLine|styleDots, Null, Null, Offset); Plot(LineArray(bars-Offset, tar6, BarCount, tar6,1), "", Clr, styleLine|styleDots, Null, Null, Offset); //Plot(LineArray(bars-Offset, SL, BarCount, sl,1), "", colorDarkRed, styleLine|styleLine, Null, Null, Offset); Plot(LineArray(bars-Offset, entry, BarCount, entry,1), "", colorGreen, styleLine|styleLine, Null, Null, Offset); for (i=bars; i