//////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// SetOption( "WarningLevel",True); _SECTION_BEGIN("Day Grid"); ShowGrid = ParamList("Grid", "Off|Grid_Day|Grid_Week|Grid_Month|Grid_Quarter|Grid_Year",1); color_Grid = ParamColor("Color_Grid",colorWhite); Style_Grid = ParamStyle("Style_Grid ",styleHistogram|styleDashed|styleNoRescale|styleOwnScale,maskAll); switch (ShowGrid ) { case "Grid_Day": Grid_Day = IIf(Day() != Ref(Day(), -1), 1, 0); Plot(Grid_Day, "", color_Grid, Style_Grid ); break; case "Grid_Week": Grid_Week = IIf(DayOfWeek() < Ref(DayOfWeek(), -1), 1, 0); Plot(Grid_Week, "", color_Grid, Style_Grid ); break; case "Grid_Month": Grid_Month = IIf(Month() != Ref(Month(),-1), 1, 0); Plot(Grid_Month, "", color_Grid, Style_Grid ); break; case "Grid_Year": Grid_year = IIf(Year() != Ref(Year(),-1), 1, 0); Plot(Grid_year, "", color_Grid, Style_Grid ); break; case "Grid_Quarter": LastDayofQuarter = Month() != Ref(Month(), 1) AND (Month() == 3 OR Month() == 6 OR Month() == 9 OR Month() == 12); Last_Quarter = IIf(Ref(LastDayofQuarter,-1), 1, 0); Plot(Last_Quarter, "", color_Grid, Style_Grid); break; case "Off": 0; break; } _SECTION_END(); _SECTION_BEGIN("Hi and LO of the day"); TLH = ParamToggle("Days Hi Lo","Off|On",1); if (TLH==1) { Hodcolorsheme=ParamColor("High of day color",colorDarkRed); LodColorscheme=ParamColor("Low of day color",colorGreen); tempnum = TimeNum(); temphi[0] = H[0]; temphiColor[0] = Hodcolorsheme; templo[0] = L[0]; temploColor[0] = LodColorscheme; for( i = 1; i < BarCount; i++ ) { if(tempnum[i] - tempnum[i-1] > Interval()) { if(H[i] > temphi[i-1]) { temphi[i] = H[i]; temphiColor[i] = Hodcolorsheme; } else { temphi[i] = temphi[i-1]; temphiColor[i] = Hodcolorsheme; } if(L[i] < templo[i-1]) { templo[i] = L[i]; temploColor[i] = LodColorscheme; } else { templo[i] = templo[i-1]; temploColor[i] = LodColorscheme; } } else { temphi[i] = H[i]; temphiColor[i] = Hodcolorsheme; templo[i] = L[i]; temploColor[i] = LodColorscheme; } } } _SECTION_END(); _SECTION_BEGIN("Chart Settings"); SetChartOptions(0,chartShowArrows|chartShowDates); SetChartBkColor(ParamColor("Outer Panel",colorBlack)); SetChartBkGradientFill(ParamColor("Upper Chart",colorDarkTeal),ParamColor("Lower Chart",colorBlack)); //GraphXSpace=Param("GraphXSpace",10,0,100,1); dec = (Param("Decimals",2,0,7,1)/10)+1; Title = EncodeColor(55)+ Title = Name() + " " + EncodeColor(ColorYellow) + Date() + " " + EncodeColor(5) + "{{INTERVAL}} " + EncodeColor(55)+ " Open = "+ EncodeColor(52)+ WriteVal(O,dec) + EncodeColor(55)+ " High = "+ EncodeColor(5) + WriteVal(H,dec) + EncodeColor(55)+ " Low = "+ EncodeColor(ColorYellow)+ WriteVal(L,dec) + EncodeColor(55)+ " Close = "+ EncodeColor(52)+ WriteVal(C,dec)+ EncodeColor(55)+ " Day High = "+ EncodeColor(52)+ WriteVal(temphi,1)+ EncodeColor(55)+ " Day Low = "+ EncodeColor(52)+ WriteVal(templo,1); LB= Param("Look Back Periods",10,1,30,1); R=ValueWhen(Cross(MA(C,LB),C),HHV(H,LB),1); S=ValueWhen(Cross(C,MA(C,LB)),LLV(L,LB),1); Color=IIf(O>C,colorRed,colorGreen); Plot (C,"Close",colorDefault,64,32); GraphXSpace=4; uptrend=PDI()>MDI()AND Signal()PDI()AND Signal()>MACD(); Plot( 2, /* defines the height of the ribbon in percent of pane width */"ribbon", IIf( uptrend, colorGreen, IIf( downtrend, colorRed, 0 )), /* choose color */ styleOwnScale|styleArea|styleNoLabel, -3.5, 100 ); icol = IIf ( MA (Close,25) > Ref (MA (Close,25),-1),colorGreen,colorRed); _SECTION_END(); _SECTION_BEGIN( "BASERECTANGEL" ); GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxSelectSolidBrush( colorDarkGrey ); GfxSelectPen( colorDarkGrey, 1 ); // broader color GfxRectangle(0,15,203,420); _SECTION_END(); _SECTION_BEGIN( "MSGRECTANGEL" ); GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxSelectSolidBrush( colorBlack ); //GfxSelectPen( colorBlue, 1 ); // broader color pxHeight = Status( "pxchartheight" ) ; y = pxHeight; GfxRectangle(243,y-145,355,y+7); _SECTION_END(); _SECTION_BEGIN("Price"); FS=Param("Font Size",20,11,100,1); GfxSelectFont("Arial", 18, 700, True ); GfxSetBkMode( colorWhite ); GfxSetTextColor( ParamColor("Color",colorWhite) ); Hor=Param("Horizontal Position",460,1,1200,1); Ver=Param("Vertical Position",25,1,830,1); GfxTextOut(""+C, Hor , Ver ); YC=TimeFrameGetPrice("C",inDaily,-1); DD=Prec(C-YC,2); _SECTION_END(); _SECTION_BEGIN("Logo"); GfxSelectFont("arial", 10, 700 ); GfxSetBkMode( colorYellow ); GfxSetTextColor( ParamColor("Color",colorYellow) ); Hor=Param("Horizontal Position",0,10,1200,1); Ver=Param("Vertical Position",390,100,50,50); GfxTextOut(" www.technotradesystem.com ",Hor , Ver ); _SECTION_END(); _SECTION_BEGIN("CName"); GfxSelectFont("arial", 11, 700 ); GfxSetTextColor( ParamColor("Color",colorYellow) ); Hor=Param("Horizontal Position",5,10,1200,1); Ver=Param("Vertical Position",430,100,50,50); pxHeight = Status( "pxchartheight" ) ; y = pxHeight; //GfxTextOut("T E C H N O T R A D E ",Hor , y-165 ); _SECTION_END(); _SECTION_BEGIN("PivotR"); pxHeight = Status( "pxchartheight" ) ; y = pxHeight; TimeFrameSet( in15Minute*2 ); DH=Ref(H,-1); DL=Ref(L,-1); DC=Ref(C,-1); pd = (O+ DH+ DL + DC )/4; sd1 = (2*pd)-DH; sd2 = pd -(DH - DL); sd3 = Sd1 - (DH-DL); rd1 = (2*pd)-DL; rd2 = pd +(DH -DL); rd3 = rd1 +(DH-DL); GfxSelectFont("arial", 11, 700 ); GfxSetTextColor( ParamColor("Color",colorRed) ); GfxTextOut("R3 : "+rd3,Hor+252 , y-138 ); GfxTextOut("R2 : "+rd2,Hor+252 , y-118 ); GfxTextOut("R1 : "+rd1,Hor+252 , y-98 ); _SECTION_END(); _SECTION_BEGIN("Pivot"); GfxSetTextColor( ParamColor("Color",colorYellow) ); GfxTextOut("PP : "+pd,Hor+252 , y-78 ); _SECTION_END(); _SECTION_BEGIN("PivotS"); GfxSetTextColor( ParamColor("Color",colorLime) ); GfxTextOut("S1 : "+sd1,Hor+252 , y-58 ); GfxTextOut("S2 : "+sd2,Hor+252 , y-38 ); GfxTextOut("S3 : "+sd3,Hor+252 , y-18 ); TimeFrameRestore(); _SECTION_END(); _SECTION_BEGIN("Flower"); Show_color = ParamToggle("Display CandleColor", "No|Yes", 1); r1 = Param( "ColorFast avg", 5, 2, 200, 1 ); r2 = Param( "ColorSlow avg", 10, 2, 200, 1 ); r3 = Param( "ColorSignal avg", 5, 2, 200, 1 ); Prd1=Param("ATR Period",4,1,20,1); Prd2=Param("Look Back",7,1,20,1); green = HHV(LLV(L,Prd1)+ATR(Prd1),Prd2); red = LLV(HHV(H,Prd1)-ATR(Prd1),Prd2); flowerClose = EMA((Open+High+Low+Close)/4,3) ; flowerOpen = EMA((Ref(Open,-1) + Ref(flowerClose,-1))/2,3); Temp = Max(High, flowerOpen); flowerHigh = EMA(Max(Temp, flowerClose),3); Temp = Min(Low,flowerOpen); flowerLow = EMA(Min(Temp, flowerClose),3); m1=MACD(r1,r2); s1=Signal(r1,r2,r3); mycolor=IIf(m1<0 AND m1>s1, colorYellow,IIf(m1>0 AND m1>s1,colorWhite,IIf(m1>0 AND m1Green ,colorWhite,IIf(C < RED,colorRed,colorWhite)); PlotOHLC( IIf(flowerOpenRef(HHV(High,Buyperiods),-1) ; Sell= C; _SECTION_BEGIN("PFE"); pds=10; x=sqrt((ROC(C,9)*ROC(C,9))+100); y=Sum(sqrt((ROC(C,1)* ROC(C,1))+1),pds); z=(x/y); pfe=EMA(IIf(C>Ref(C,-9),z,-z)*100,5); rsidn=pfe <-10 AND pfe10 AND pfe>Ref(pfe,-1); rsiresult1 = WriteIf( rsiup,"cu", ""); rsiresult2 = WriteIf( rsidn,"cd", ""); RequestTimedRefresh( 0 ); GfxSelectFont( "Tahoma", 12, 120 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorWhite ); if ( rsiresult1 =="cu") { GfxSelectSolidBrush( ColorRGB(0,90,0) ); } else if ( rsiresult2 =="cd") { GfxSelectSolidBrush( ColorRGB(90,0,0)); } else if ( rsiresult2 =="") { GfxSelectSolidBrush( ColorRGB(0,0,94) ); } GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxCircle( 100,90,50 ); _SECTION_END(); //GfxRoundRect( 15,305,135,215, 5, 5 ); GfxCircle( 100,100,70 ); _SECTION_END(); _SECTION_BEGIN("STC"); _SECTION_BEGIN("Schaff Trend Cycle"); /* Ported directly from original STC Tradestation code results differ from other Amibroker versions that are not based directly on original EasyLanguage code http://mediaserver.fxstreet.com/Reports/99afdb5f-d41d-4a2c-802c-f5d787df886c/ebfbf387-4b27-4a0f-848c-039f4ab77c00.pdf */ MA1=23; MA2=50; TCLen=10; MA1=Param("ShortMACDLen",23,5,36); MA2=Param("LOngMACDLen",50,10,100); TCLen=Param("TCLen(StochPeriod)",10,5,20); Factor=.5; //Calculate a MACD Line XMac = MACD(MA1,MA2) ; // MACD in Amibroker always uses Close for MACD calculation //1st Stochastic: Calculate Stochastic of a MACD Value1 = LLV(XMac, TCLen); Value2 = HHV(XMac, TCLen) - Value1; //Frac1=1; // prime Frac1 to a default of 1 //Frac1 = IIf(Value2 > 0, ((XMac - Value1) / Value2) * 100, Ref(FRAC1,-1)); // have to "prime" first value so that reference to "i-1" does not result in subscript out of range // since MACD for both periods is not defined until MA2 period, 0 seems to be mathematically correct priming value frac1=0; for (i = 1; i < BarCount; i++) { if (Value2[i] > 0) { frac1[i] = ((XMac[i] - Value1[i])/Value2[i])*100; } else { frac1[i]= frac1[i-1]; } } //Smoothed calculation for %FastD of MACD PF[0]=frac1[0]; PF[1]=frac1[1]; for (i = 2; i < BarCount; i++) { PF[i]=PF[i-1]+(Factor*(frac1[i]-PF[i-1])); } //2nd Stochastic: Calculate Stochastic of Smoothed Percent FastD, above. Value3 = LLV(PF, TCLen); Value4 = HHV(PF, TCLen) - Value3; //%FastK of PF /* Frac2=1; Frac2 = IIf(Value4 > 0, ((PF - Value3) / Value4) * 100, Ref(FRAC2,-1)); */ frac2[0]=0; for (i = 1; i < BarCount; i++) { if (Value4[i] > 0 ) { frac2[i]=((PF[i] - Value3[i])/Value4[i])*100; } else { frac2[i]=frac2[i-1]; } } //Smoothed calculation for %FastD of PF PFF[0]=frac2[0]; PFF[1]=frac2[1]; for (i = 2; i < BarCount; i++) { PFF[i]=PFF[i-1]+(Factor*(frac2[i]-PFF[i-1])); } //HT=ParamColor("HT", colorRed ); rsidn=pff <2; rsiup=pff >98; rsiresult1 = WriteIf( rsiup,"cu", ""); rsiresult2 = WriteIf( rsidn,"cd", ""); RequestTimedRefresh( 0 ); GfxSelectFont( "Tahoma", 12, 120 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorWhite ); if ( rsiresult1 =="cu") { GfxSelectSolidBrush( ColorRGB(0,120,0) ); } else if ( rsiresult2 =="cd") { GfxSelectSolidBrush( ColorRGB(120,0,0)); } else if ( rsiresult2 =="") { GfxSelectSolidBrush( ColorRGB(0,0,94) ); } GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxCircle( 100,100,60 ); _SECTION_END(); _SECTION_BEGIN("rsi"); //HT=ParamColor("HT", colorRed ); rsidn=RSI(7) <30; rsiup=RSI(7) >70; rsiresult1 = WriteIf( rsiup,"cu", ""); rsiresult2 = WriteIf( rsidn,"cd", ""); RequestTimedRefresh( 0 ); GfxSelectFont( "Tahoma", 12, 120 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorWhite ); if ( rsiresult1 =="cu") { GfxSelectSolidBrush( ColorRGB(0,150,0) ); } else if ( rsiresult2 =="cd") { GfxSelectSolidBrush( ColorRGB(150,0,0)); } else if ( rsiresult2 =="") { GfxSelectSolidBrush( ColorRGB(0,0,94) ); } GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxCircle( 100,100,50 ); _SECTION_END(); _SECTION_BEGIN("Rays"); //FT=ParamColor("FT", colorRed ); Pp1=3; Pp2=2; CS33=HHV(LLV(flowerHigh,Pp1)-ATR(Pp2),4); CR33=HHV(LLV(flowerHigh,Pp1)-ATR(Pp2),5); AtrupTrendCond1 = flowerClose> CS33 ; AtrdnTrendCond1 =CS33>flowerClose ; ATRup = WriteIf(AtrupTrendCond1,"atrup", ""); ATRdown= WriteIf( AtrdnTrendCond1,"atrdn", ""); if ( ATRup =="atrup") { GfxSelectSolidBrush( ColorRGB(0,180,0) ); } else if (ATRdown =="atrdn") { GfxSelectSolidBrush( ColorRGB(180,0,0)); } else if ( ATRdown =="") { GfxSelectSolidBrush( ColorRGB(0,0,94) ); } GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxSelectPen( colorBlue, 1 ); // broader color GfxCircle( 100,100,40 ); _SECTION_END(); _SECTION_BEGIN("Exit_Beast-3"); //GT=ParamColor("GT", colorRed ); EntrylookbackPeriod=10; EntryATRperiod=1.9; EntrySig = C > ( LLV( flowerLow, EntrylookbackPeriod ) + EntryATRperiod * ATR( 10 ) ); ExitSig = C < ( HHV( flowerHigh, EntrylookbackPeriod ) -EntryATRperiod * ATR( 10 ) ); RequestTimedRefresh( 0 ); GfxSelectFont( "Tahoma", 12, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorWhite ); EntryB = WriteIf( EntrySig,"eu", ""); ExitB = WriteIf( ExitSig,"ed", ""); if ( EntryB =="eu") { GfxSelectSolidBrush( ColorRGB(0,210,0) ); // } else if ( ExitB =="ed") { GfxSelectSolidBrush( ColorRGB(210,0,0)); // } else if ( ExitB =="") { GfxSelectSolidBrush( ColorRGB(0,0,94) ); } GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxSelectPen( colorBlue, 1 ); // broader color GfxCircle( 100,100,30 );// changing the value of x,y,rad x-70, y-90, rad-24 _SECTION_END(); _SECTION_BEGIN("CCI9-2"); //HT=ParamColor("HT", colorRed ); ccidn=CCI(8) < 0; cciup=CCI(9) > 0; ccresult1 = WriteIf( cciup,"cu", ""); ccresult2 = WriteIf( ccidn,"cd", ""); RequestTimedRefresh( 0 ); GfxSelectFont( "Tahoma", 12, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorWhite ); if ( ccresult1 =="cu") { GfxSelectSolidBrush( ColorRGB(0,240,0) ); } else if ( ccresult2 =="cd") { GfxSelectSolidBrush( ColorRGB(240,0,0)); } else if ( ccresult2 =="") { GfxSelectSolidBrush( ColorRGB(0,0,94) ); } GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxSelectPen( colorBlue, 1 ); // broader color GfxCircle( 100,100,20); _SECTION_END(); _SECTION_BEGIN("%BB7-1"); //IT=ParamColor("IT", colorRed ); p=7; x=((C+2*StDev(C,p)-MA(C,p))/(4*StDev(C,p)))*100; bbdown= x < 40; bbup= x > 40; bbresult1 = WriteIf( bbup,"bu", ""); bbresult2 = WriteIf( bbdown,"bd", ""); bbresult3 = WriteIf( C,"bearishrevers", ""); RequestTimedRefresh( 0 ); GfxSelectFont( "Tahoma", 12, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorWhite ); if ( bbresult1 =="bu") { GfxSelectSolidBrush( ColorRGB(62,255,62) ); } else if ( bbresult2 =="bd") { GfxSelectSolidBrush( ColorRGB(255,62,62) ); } else if ( bbresult2 =="") { GfxSelectSolidBrush( ColorRGB(0,0,94) ); } GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxSelectPen( colorBlue, 1 ); // broader color GfxCircle( 100,100,10 ); _SECTION_END(); _SECTION_BEGIN("MACDHIGHBULLISH"); r1 = Param( "Fast avg", 12, 2, 200, 1 ); r2 = Param( "Slow avg", 26, 2, 200, 1 ); r3 = Param( "Signal avg", 9, 2, 200, 1 ); r4 = Param( "Wk slow", 17, 2, 200, 1 ); r5 = Param( "Wk fast", 8, 2, 200, 1 ); m1=MACD(r1,r2); s1=Signal(r1,r2,r3); rsidn=m1>0 AND m1>s1; rsiresult2 = WriteIf( rsidn,"cd", ""); if ( rsiresult2 =="cd") { GfxSelectSolidBrush( ColorRGB(0,147,0)); } else if ( rsiresult2 =="") { GfxSelectSolidBrush( ColorRGB(0,0,94) ); } RequestTimedRefresh( 0 ); GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxSelectPen( colorBlue, 1 ); // broader color GfxRectangle(80,220,120,280); _SECTION_END(); _SECTION_BEGIN("MACDLOWHBULLISH"); r1 = Param( "Fast avg", 12, 2, 200, 1 ); r2 = Param( "Slow avg", 26, 2, 200, 1 ); r3 = Param( "Signal avg", 9, 2, 200, 1 ); r4 = Param( "Wk slow", 17, 2, 200, 1 ); r5 = Param( "Wk fast", 8, 2, 200, 1 ); m1=MACD(r1,r2); s1=Signal(r1,r2,r3); rsidn=m1<0 AND m1>s1; rsiresult2 = WriteIf( rsidn,"cd", ""); if ( rsiresult2 =="cd") { GfxSelectSolidBrush( ColorRGB(0,147,0)); } else if ( rsiresult2 =="") { GfxSelectSolidBrush( ColorRGB(0,0,94) ); } RequestTimedRefresh( 0 ); GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBlue ); GfxSelectPen( colorBlue, 1 ); // broader color GfxRectangle(120,315,180,280); _SECTION_END(); _SECTION_BEGIN("MACDLOWHBEARISH"); r1 = Param( "Fast avg", 12, 2, 200, 1 ); r2 = Param( "Slow avg", 26, 2, 200, 1 ); r3 = Param( "Signal avg", 9, 2, 200, 1 ); r4 = Param( "Wk slow", 17, 2, 200, 1 ); r5 = Param( "Wk fast", 8, 2, 200, 1 ); m1=MACD(r1,r2); s1=Signal(r1,r2,r3); rsidn=m1>0 AND m1 C1; dc = C <= C1; ud = C > O; dd = C <= O; green = 1; blue = 2; yellow = 3; red = 4; white = 5; VType = IIf(ud, IIf(uc, green, yellow), IIf(dd, IIf(dc, red, blue), white)); /* green volume: up-day and up-close*/ gv = IIf(VType == green, V, 0); /* yellow volume: up-day but down-close */ yv = IIf(VType == yellow, V, 0); /* red volume: down-day and down-close */ rv = IIf(VType == red, V, 0); /* blue volume: down-day but up-close */ bv = IIf(VType == blue, V, 0); uv = gv + bv; uv1 = Ref(uv, -1); /* up volume */ dv = rv + yv; dv1 = Ref(dv, -1); /* down volume */ VolPer = Param("Adjust Vol. MA per.", 10, 1, 255, 1); ConvPer = Param("Adjust Conv. MA per.", 4, 1, 255, 1); MAuv = TEMA(uv, VolPer ); mauv1 = Ref(mauv, -1); MAdv = TEMA(dv, VolPer ); madv1 = Ref(madv, -1); MAtv = TEMA(V, VolPer );//total volume //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// Converge = (TEMA(MAuv - MAdv, ConvPer)); Converge1 = Ref(Converge, -1); ConvergeUp = Converge > Converge1; ConvergeOver = Converge > 0; rising = ConvergeUp AND ConvergeOver; falling = !ConvergeUp AND ConvergeOver; _SECTION_END(); _SECTION_BEGIN("bearishline"); GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorRed ); GfxSelectPen( colorRed, 1 ); GfxMoveTo( 25,320 ); GfxLineTo( 75, 370 ); _SECTION_END(); _SECTION_BEGIN("bullishline"); GfxSelectFont( "Arial", 10, 100 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorGreen ); GfxSelectPen( colorGreen, 1 ); //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// GfxMoveTo( 125,225 ); GfxLineTo( 175, 275 ); _SECTION_END(); _SECTION_BEGIN("trendline"); farback=Param("How Far back to go",100,50,5000,10); nBars = Param("Number of bars", 12, 5, 40); aHPivs = H - H;aLPivs = L - L; aHPivHighs = H - H;aLPivLows = L - L;aHPivIdxs = H - H;aLPivIdxs = L - L; nHPivs = 0;nLPivs = 0;lastHPIdx = 0;lastLPIdx = 0;lastHPH = 0;lastLPL = 0; curPivBarIdx = 0; //aHHVBars = HHVBars(H, nBars);aLLVBars = LLVBars(L, nBars); //aHHV = HHV(H, nBars);aLLV = LLV(L, nBars); //aVisBars = Status("barvisible");nLastVisBar = LastValue(Highest(IIf(aVisBars, BarIndex(), 0))); //_TRACE("Last visible bar: " + nLastVisBar); //curBar = (BarCount-1);curTrend = "";if (aLLVBars[curBar] < aHHVBars[curBar]) { //curTrend = "D";}else {curTrend = "U";} //for (i=0; istartt-10,trendlineS,-1e10); _SECTION_END(); _SECTION_BEGIN("trendlineA"); dn=g3>C; up=g3C; up=g3 prev AND C[ i - 1 ] > prev) { trailArray[ i ] = Max(prev,C[ i ] - trBull[ i ]); } else if (C[ i ] < prev AND C[ i - 1 ] < prev) { trailArray[ i ] = Min(prev,C[ i ] + trBear[ i ]); } else if (C[ i ] > prev) { trailArray[ i ] = C[ i ] - trBull[ i ]; } else { trailArray[ i ] = C[ i ] + trBear[ i ]; } } return trailArray; } per = 20; multBull = 2; multBear = 2; trBull = multBull * ATR(per); trBear = multBear * ATR(per); trailArray = vstop_func(trBull,trBear); s0=trailArray; s1= s0 > C ; s2= s0 C ; s2= s0 Ref(res,-1),1,IIf(C1;i--) { if(Buy[i] == 1) { entry = C[i]; sig = "Buy"; sl = s5d[i]; tar1 = entry + (entry * .00222); tar2 = entry + (entry * .00301); tar3 = entry + (entry * .00583); bars = i; i = 0; } if(Sell[i] == 1) { sig = "Sell"; entry = C[i]; sl = s5d[i]; tar1 = entry - (entry * .0022); tar2 = entry - (entry * .0030); tar3 = entry - (entry * .0058); bars = i; i = 0; } } Offset = 20; Clr = IIf(sig == "Buy", colorLime, colorRed); ssl = IIf(bars == BarCount-1, s5d[BarCount-1], Ref(s5d, -1)); //s1 = ssl[BarCount-1]; Targets = ParamToggle("Targets","Show|Hide",1); if (Targets == 1 ) { Plot(LineArray(bars-Offset, tar1, BarCount, tar1,1), "", Clr, styleLine|styleDashed, Null, Null, Offset); Plot(LineArray(bars-Offset, tar2, BarCount, tar2,1), "", Clr, styleLine|styleDashed, Null, Null, Offset); Plot(LineArray(bars-Offset, tar3, BarCount, tar3,1), "", Clr, styleLine|styleDashed, Null, Null, Offset); } //Plot(LineArray(bars-Offset, s1, BarCount, s0,1), "", colorWhite, styleLine|styleLine, Null, Null, Offset); Plot(LineArray(bars-Offset, entry, BarCount, entry,1), "", colorLightBlue, styleLine|styleDots, Null, Null, Offset); for (i=bars; i buytarget[i] AND btf1==0) { Sell[ i ] = 1; SellPrice[i] = buytarget[i]; btf1 = 1; btf11[i] = 1; //LongFlag = 0; } if( LongFlag==1 AND High[i]>buytarget1[i] AND btf1==1 AND btf2==0) { Sell[ i ] = 1; SellPrice[i] = buytarget1[i]; //LongFlag = 0; btf2=1; btf22[i]=1; } if( LongFlag==1 AND High[i]>buytarget2[i] AND btf1==1 AND btf2==1 ) { Sell[ i ] = 1; SellPrice[i] = buytarget2[i]; LongFlag = 0; btf33[i]=1; } if( LongFlag==1 AND _sell[i]) { Sell[ i ] = 1; SellPrice[i] = buysl[i]; LongFlag = 0; } //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// if( _Short[ i ] AND LongFlag == 0 AND ShortFlag==0) { Short[ i ] = 1; ShortPrice[i]=c[i]; _ShortPrice =c[i]; ShortFlag = 1; //entry = C[i]; sig = "Short"; sl = s5d[i]; shorttarget = tar1[i]; shorttarget1 = tar2[i] ; shorttarget2 = tar3[i]; stf1 = 0; stf2=0; } if( ShortFlag==1 AND low[i]Ref(HHV(High,Buyperiods),-1) ; _Sell= C Ref (MA (Close,25),-1),colorGreen,colorRed); Plot( MA( High, 25 ),"", icol, styleThick); Plot( MA( Low, 25 ), "",icol, styleThick); _SECTION_END(); //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// GfxSetBkMode(1); _SECTION_BEGIN("NMN Chart Stamp"); SetFormulaName("NMN Chart Stamp"); GfxFont = "Times New Roman"; GfxSetOverlayMode(0); GfxSelectFont(GfxFont, Status("pxheight")/25); GfxSetTextAlign(6); // center alignment GfxSetTextColor(ColorRGB(100,100,100)); GfxSetBkMode(0); // transparent GfxTextOut(Name(), Status("pxwidth")/2, Status("pxheight")/12); GfxSetTextColor(ColorRGB(200,200,200)); GfxTextOut("Easyalgo.in", Status("pxwidth")/1.15, Status("pxheight")/1.15); //GfxSelectFont(GfxFont, Status("pxheight")/28); //GfxSelectFont(GfxFont, Status("pxheight")/18); //GfxSelectFont("Tahoma", Status("pxheight")/18); _SECTION_END();