//////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// SetBarsRequired(sbrAll,sbrAll); SetChartOptions(0,chartShowArrows|chartShowDates|chartWrapTitle); SetBarFillColor( IIf( C > O, colorBrightGreen, colorRed ) ); Plot( C, "Price", IIf( C > O, colorBrightGreen,colorRed ), styleCandle|styleNoTitle|styleNoLabel ); Plot( C, "Price", colorWhite,styleNoLine|styleNoTitle); Title = StrFormat("{{NAME}} - {{INTERVAL}} - {{DATE}}"+ EncodeColor(colorOrange)+ "\n OPEN = "+Open+" HIGH = "+High+" LOW = "+Low+" CLOSE = "+Close+ " CHANGE = "+Prec( ROC( C, 1 ), 2) +"%%"); _SECTION_BEGIN("Intraday Timing Condition"); FirstTradeTime = ParamTime( "Start Time", "09:15" ); // Earliest time to take a trade LastTradeTime = ParamTime( "End Time", "15:00" ); // Latest time to take new trades ExitAllPositionsTime = ParamTime( "Exit Time", "15:20" ); // Exit all trades Entrytimecondition = (TimeNum() >= FirstTradeTime AND TimeNum() <= LastTradeTime ); Exittimecondition = Cross(TimeNum(),ExitAllPositionsTime); _SECTION_END(); cc=TimeFrameGetPrice("C",inDaily,-1); hh=TimeFrameGetPrice("H",inDaily,-1); ll=TimeFrameGetPrice("L",inDaily,-1); r6=Cc+(hH-lL)*1.25; r5=cC+(hH-lL)*1.0106; r4=cC+(hH-lL)*0.55; r3=cC+(hH-lL)*0.275; r2=cC+(hH-lL)*0.1833; r1=cC+(hH-lL)*0.0916; s1=cC-(hH-lL)*0.0916; s2=cC-(hH-lL)*0.1833; s3=cC-(hH-lL)*0.275; s4=cC-(hH-lL)*0.55; s5=cC-(hH-lL)*1.0106; s6=cC-(hH-lL)*1.25; dn = Day(); newday = dn != Ref( dn, -1 ); bar=BarsSince(newday)+1; a=Param("Entry Buffer %",0.1,0,10,0.01)/100; bt11=r5+(r5*a); bt12=r6+(r6*a); st11=r2-(r2*a); st12=r1-(r1*a); st13=s1-(s1*a); st14=s2-(s2*a); bt21=r1+(r1*a); bt22=r2+(r2*a); bt23=r3+(r3*a); bt24=r4+(r4*a); st21=r1-(r1*a); st22=s1-(s1*a); st23=s2-(s2*a); st24=s3-(s3*a); bt31=s2+(s2*a); bt32=s1+(s1*a); bt33=r1+(r1*a); bt34=r2+(r2*a); st31=s5-(s5*a); st32=s6-(s6*a); slb=Param("SL Buffer %",0,0,10,0.1)/100; bs1=R4;//r3; BS1=bs1-(bs1*slb); sss1=R3;//r4; SSS1=SSS1+(SSS1*slb); bs2=S1;//s2; BS2=bs2-(bs2*slb); sss2=R2;//r3; SSS2=SSS2+(SSS2*slb); bs3=S3;//s4; BS3=bs3-(bs3*slb); sss3=S4;//s3; SSS3=SSS3+(SSS3*slb); //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// r4on=ParamList("R4 Buy","ON|OFF"); S1on=ParamList("S1 Buy","ON|OFF"); S3on=ParamList("S3 Buy","ON|OFF"); r3on=ParamList("R3 Short","ON|OFF"); r2on=ParamList("R2 Short","ON|OFF"); S4on=ParamList("S4 Short","ON|OFF"); bb1=BarsSince(newday)>BarsSince(Cross(C,r4)) AND BarsSince(Cross(C,r4))>BarsSince(Cross(C,r4+(r4*a))) AND Ref(BarsSince(Cross(C,r4))BarsSince(Cross(C,s1)) AND BarsSince(Cross(C,s1))>BarsSince(Cross(C,s1+(s1*a))) AND Ref(BarsSince(Cross(C,s1))BarsSince(Cross(C,s3)) AND BarsSince(Cross(C,s3))>BarsSince(Cross(C,s3+(s3*a))) AND Ref(BarsSince(Cross(C,s3))BarsSince(Cross(r3,C)) AND BarsSince(Cross(r3,C))>BarsSince(Cross(r3-(r3*a),C)) AND Ref(BarsSince(Cross(r3,C))BarsSince(Cross(r2,C)) AND BarsSince(Cross(r2,C))>BarsSince(Cross(r2-(r2*a),C)) AND Ref(BarsSince(Cross(r2,C))BarsSince(Cross(s4,C)) AND BarsSince(Cross(s4,C))>BarsSince(Cross(s4-(s4*a),C)) AND Ref(BarsSince(Cross(s4,C))BarsSince(Cross(s4,C)); c2=BarsSince(Cross(s4,C))>BarsSince(Cross(s4-(s4*a),C)); c3=Ref(BarsSince(Cross(s4,C))SS0;//Cross(h,ss0); cov5=cov5 AND Sum(cov5,BarsSince(Short))==1; cov6=Exittimecondition; bff=ExRem(Buy,sell4) OR ExRem(Buy,sell5) OR ExRem(Buy,sell6); Sell= (bf==1 OR Ref(bf,-1)==1) AND (sell1 OR sell2 OR sell3 OR sell4 OR sell5 OR sell6); "sell=="+Sell; Cover= (sf==1 OR Ref(sf,-1)==1) AND (cov1 OR cov2 OR cov3 OR cov4 OR cov5 OR cov6); Buy=ExRem(Buy,Sell AND sell4) OR ExRem(Buy, Sell AND sell5) OR ExRem(Buy, Sell AND sell6); "buyfir=="+Buy; Short=ExRem(Short,Cover AND cov4) OR ExRem(Short,Cover AND cov5) OR ExRem(Short,Cover AND cov6); bnf=snf=bnff=snff=0;buy11=Buy;short11=Short;"short11=="+short11; sell1p=Sell AND sell4==0 AND sell5==0 AND sell6==0; sell11=Sell AND (sell4==1 OR sell5==1 OR sell6==1); "sell11=="+sell11; cover1p=Cover AND cov4==0 AND cov5==0 AND cov6==0; cover11=Cover AND (cov4==1 OR cov5==1 OR cov6==1); Buy=Sell=Short=Cover=Null;btach=stach=0;sel=cov=0;bxtype=0; sxtype=0; sho=0;bnf1=snf1=0; for( i = 0; i < BarCount; i++ ) {snff[i]=snf[i]; if(bnf==0 AND buy11[i] AND snf!=1) { Buy[i]=1; bnf=1; } bnf1[i]=bnf[i]; if(bnf==1 AND sell11[i]) { Sell[i]=1; bnf=0; btach=0; sel[i]=1; bxtype[i]=4; } else if(bnf==1 AND sell1p[i] AND sell1[i] AND btach==0 ) { Sell[i]=1; btach=1; sel[i]=2; bxtype[i]=1; } else if(bnf==1 AND sell1p[i] AND sell2[i] AND btach==1 ) { Sell[i]=1; btach=2; sel[i]=2; bxtype[i]=2; } else if(bnf==1 AND sell1p[i] AND sell3[i] AND btach==2 ) { Sell[i]=1; btach=3; sel[i]=2; bxtype[i]=3; } snf1[i]=snf[i]; if(snf==0 AND short11[i] AND bnf!=1 ) { Short[i]=1; snf=1; } sho[i]=Short[i]; if(snf==1 AND cover1p[i] AND cov1[i] AND stach==0) { Cover[i]=1; stach=1; cov[i]=2; sxtype[i]=1; } else if(snf==1 AND cover1p[i] AND cov2[i] AND stach==1) { Cover[i]=1; stach=2; cov[i]=2; sxtype[i]=2; } else if(snf==1 AND cover1p[i] AND cov3[i] AND stach==2) { Cover[i]=1; stach=3; cov[i]=2; sxtype[i]=3; } else if(snf==1 AND cover11[i]) { Cover[i]=1; snf=0; stach=0; cov[i]=1; sxtype[i]=4; } } dlong= ParamToggle("Disable Long?", "NO|YES"); dshort= ParamToggle("Disable Short?", "NO|YES"); "sho=="+sho; "bnf1=="+bnf1; "snf1=="+snf1; if(dlong){Buy=Sell=0;} if(dshort){Short=Cover=0;} PlotShapes( IIf( Buy, shapeSquare, shapeNone ), colorGreen, 0, L, Offset = -40 ); PlotShapes( IIf( Buy, shapeSquare, shapeNone ), colorLime, 0, L, Offset = -50 ); PlotShapes( IIf( Buy, shapeUpArrow, shapeNone ), colorWhite, 0, L, Offset = -45 ); //PlotShapes( IIf( Sell AND sell4==0 AND sell5==0 AND sell6==0, shapeStar, shapeNone ), colorRed, 0, h, Offset = 65 ); //PlotShapes( IIf( Sell AND (sell4==1 OR sell5==1 OR sell6==1), shapeDownArrow, shapeNone ), colorRed, 0, H, Offset = -65 ); PlotShapes( IIf( Sell AND sel==2, shapeStar, shapeNone ), colorRed, 0, h, Offset = 65 ); PlotShapes( IIf( Sell AND sel==1, shapeDownArrow, shapeNone ), colorRed, 0, H, Offset = -65 ); PlotShapes( IIf( Short, shapeSquare, shapeNone ), colorRed, 0, H, Offset = 40 ); PlotShapes( IIf( Short, shapeSquare, shapeNone ), colorOrange, 0, H, Offset = 50 ); PlotShapes( IIf( Short, shapeDownArrow, shapeNone ), colorWhite, 0, H, Offset = -45 ); //PlotShapes( IIf( Cover AND cov4==0 AND cov5==0 AND cov6==0, shapeStar, shapeNone ), colorBlue, 0, l, Offset = -65 ); //PlotShapes( IIf( Cover AND (cov4==1 OR cov5==1 OR cov6==1), shapeUpArrow, shapeNone ), colorBlue, 0, L, Offset = -65 ); PlotShapes( IIf( Cover AND cov==2, shapeStar, shapeNone ), colorBlue, 0, l, Offset = -65 ); PlotShapes( IIf( Cover AND cov==1, shapeUpArrow, shapeNone ), colorBlue, 0, L, Offset = -65 ); Plot(r1,"",colorGreen,styleDashed); Plot(r2,"",colorGreen,styleDashed); Plot(r3,"",colorGreen,styleDashed); Plot(r4,"",colorGreen,styleDashed); Plot(r5,"",colorGreen,styleDashed); Plot(r6,"",colorGreen,styleDashed); Plot(s1,"",colorRed,styleDashed); Plot(s2,"",colorRed,styleDashed); Plot(s3,"",colorRed,styleDashed); Plot(s4,"",colorRed,styleDashed); Plot(s5,"",colorRed,styleDashed); Plot(s6,"",colorRed,styleDashed); //bfl=Flip(Buy,Sell AND sel==1) OR (Sell AND sel==1); //sfl=Flip(Short,Cover AND cov==1) OR (Cover AND cov==1); //Plot(IIf(bfl,bs,Null),"",colorOrange,styleLine,Null,Null,0,1,2); //Plot(IIf(bfl,bt1,Null),"",colorLime,styleLine,Null,Null,0,1,2); //Plot(IIf(bfl,bt2,Null),"",colorLime,styleLine,Null,Null,0,1,2); //Plot(IIf(bfl,bt3,Null),"",colorLime,styleLine,Null,Null,0,1,2); //Plot(IIf(bfl,bt4,Null),"",colorLime,styleLine,Null,Null,0,1,2); //Plot(IIf(sfl,ss,Null),"",colorBlue,styleLine,Null,Null,0,1,2); //Plot(IIf(sfl,st1,Null),"",colorOrange,styleLine,Null,Null,0,1,2); //Plot(IIf(sfl,st2,Null),"",colorOrange,styleLine,Null,Null,0,1,2); //Plot(IIf(sfl,st3,Null),"",colorOrange,styleLine,Null,Null,0,1,2); //Plot(IIf(sfl,st4,Null),"",colorOrange,styleLine,Null,Null,0,1,2); //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// eqty=Param("Entry QTY",100,3,10000); xqty1=Param("First Target Exit QTY",25,1,10000); xqty2=Param("Second Target Exit QTY",25,1,10000); xqty3=Param("Third Target Exit QTY",25,1,10000); bxqty=IIf(bxtype==4 AND btach==0,eqty,IIf(bxtype==4 AND btach==1,eqty-xqty1,IIf(bxtype==4 AND btach==2,eqty-xqty1-xqty2,IIf(bxtype==4 AND btach==3,eqty-xqty1-xqty2-xqty3, IIf(bxtype==1 ,xqty1,IIf(bxtype==2 ,xqty2,IIf(bxtype==3,xqty3,0))))))); sxqty=IIf(sxtype==4 AND stach==0,eqty,IIf(sxtype==4 AND stach==1,eqty-xqty1,IIf(sxtype==4 AND stach==2,eqty-xqty1-xqty2,IIf(sxtype==4 AND stach==3,eqty-xqty1-xqty2-xqty3, IIf(sxtype==1 ,xqty1,IIf(sxtype==2 ,xqty2,IIf(sxtype==3,xqty3,0))))))); eqty=eqty; xqty=IIf(Sell,bxqty,IIf(Cover,sxqty,0)); token1=ParamStr("Telegram API","1353636937:AAFL16rGqebgKfQplmFcvNLPVDyhpe7Nb0E"); b1cid1=ParamStr("Chat_ID"," -1001328913351"); BuyPrice=ValueWhen(Buy,C); ShortPrice=ValueWhen(Short,C); url1="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=BUY "+name()+" date="+Date()+" Buyprice: "+BuyPrice; url2="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=first target of buy is achieved in "+name()+" date="+Date()+" Sell at : "+bt1+" exit qty: "+bxqty; url3="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=second target of buy is achieved in "+name()+" date="+Date()+" Sell at : "+bt2+" exit qty: "+bxqty; url4="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=third target of buy is achieved in "+name()+" date="+Date()+" Sell at : "+bt3+" exit qty: "+bxqty; url5="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=fourth target of buy is achieved in "+name()+" date="+Date()+" Sell at : "+bt4+" exit qty: "+bxqty; url6="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=exit buy in "+name()+" date="+Date()+" Sell at : "+ValueWhen(Sell,C)+" exit qty: "+bxqty; url7="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=SHORT "+name()+" date="+Date()+" Shortprice: "+ShortPrice; url8="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=first tarfet of short is achiveved in "+name()+" date="+Date()+" Cover at: "+st1+" exit qty: "+sxqty; url9="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=second tarfet of short is achiveved in "+name()+" date="+Date()+" Cover at: "+st2+" exit qty: "+sxqty; url10="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=third tarfet of short is achiveved in "+name()+" date="+Date()+" Cover at: "+st3+" exit qty: "+sxqty; url11="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=fourth tarfet of short is achiveved in "+name()+" date="+Date()+" Cover at: "+st4+" exit qty: "+sxqty; url12="https://api.telegram.org/bot"+token1+"/sendMessage?chat_id="+b1cid1+"&text=exit short in "+name()+" date="+Date()+" Cover at: "+ValueWhen(Cover,C)+" exit qty: "+sxqty; if (LastValue(Buy)==True AND StaticVarGet(Name()+GetChartID()+"buy")==0 ) { AlertIF( LastValue(Buy), "EXEC " +url1, "", 1); StaticVarSet(Name()+GetChartID()+"buy",1); } else if (LastValue(Buy) != True) { StaticVarSet(Name()+GetChartID()+"buy",0); } if (LastValue(Sell)==True AND LastValue(bxtype)==1 AND StaticVarGet(Name()+GetChartID()+"sell1")==0 ) { AlertIF( LastValue(Sell), "EXEC " +url2, "", 2); StaticVarSet(Name()+GetChartID()+"sell1",1); } else if (LastValue(Sell) != True )//AND LastValue(bxtype)!=1) { StaticVarSet(Name()+GetChartID()+"sell1",0); } if (LastValue(Sell)==True AND LastValue(bxtype)==2 AND StaticVarGet(Name()+GetChartID()+"sell2")==0 ) { AlertIF( LastValue(Sell), "EXEC " +url3, "", 2); StaticVarSet(Name()+GetChartID()+"sell2",1); } else if (LastValue(Sell) != True )//AND LastValue(bxtype)!=2) { StaticVarSet(Name()+GetChartID()+"sell2",0); } if (LastValue(Sell)==True AND LastValue(bxtype)==3 AND StaticVarGet(Name()+GetChartID()+"sell3")==0 ) { AlertIF( LastValue(Sell), "EXEC " +url4, "", 2); StaticVarSet(Name()+GetChartID()+"sell3",1); } else if (LastValue(Sell) != True )//AND LastValue(bxtype)!=3) { StaticVarSet(Name()+GetChartID()+"sell3",0); } if (LastValue(Sell)==True AND LastValue(bxtype)==4 AND LastValue(sell4)==1 AND StaticVarGet(Name()+GetChartID()+"sell4")==0 ) { AlertIF( LastValue(Sell), "EXEC " +url5, "", 2); StaticVarSet(Name()+GetChartID()+"sell4",1); } else if (LastValue(Sell) != True )//AND LastValue(bxtype)!=4 AND LastValue(sell4)!=1 ) { StaticVarSet(Name()+GetChartID()+"sell4",0); } if (LastValue(Sell)==True AND LastValue(bxtype)==4 AND LastValue(sell4)!=1 AND StaticVarGet(Name()+GetChartID()+"sell5")==0 ) { AlertIF( LastValue(Sell), "EXEC " +url6, "", 2); StaticVarSet(Name()+GetChartID()+"sell5",1); } else if (LastValue(Sell) != True )// AND LastValue(bxtype)!=4 AND LastValue(sell4)!=1 ) { StaticVarSet(Name()+GetChartID()+"sell5",0); } if (LastValue(Short)==True AND StaticVarGet(Name()+GetChartID()+"short")==0 ) { AlertIF( LastValue(Short), "EXEC " +url7, "", 3); StaticVarSet(Name()+GetChartID()+"short",1); } else if (LastValue(Short) != True) { StaticVarSet(Name()+GetChartID()+"short",0); } if (LastValue(Cover)==True AND LastValue(sxtype)==1 AND StaticVarGet(Name()+GetChartID()+"Cover1")==0 ) { AlertIF( LastValue(Cover), "EXEC " +url8, "", 4); StaticVarSet(Name()+GetChartID()+"Cover1",1); } else if (LastValue(Cover) != True) { StaticVarSet(Name()+GetChartID()+"Cover1",0); } if (LastValue(Cover)==True AND LastValue(sxtype)==2 AND StaticVarGet(Name()+GetChartID()+"Cover2")==0 ) { AlertIF( LastValue(Cover), "EXEC " +url9, "", 4); StaticVarSet(Name()+GetChartID()+"Cover2",1); } else if (LastValue(Cover) != True) { StaticVarSet(Name()+GetChartID()+"Cover2",0); } if (LastValue(Cover)==True AND LastValue(sxtype)==3 AND StaticVarGet(Name()+GetChartID()+"Cover3")==0 ) { AlertIF( LastValue(Cover), "EXEC " +url10, "", 4); StaticVarSet(Name()+GetChartID()+"Cover3",1); } else if (LastValue(Cover) != True) { StaticVarSet(Name()+GetChartID()+"Cover3",0); } if (LastValue(Cover)==True AND LastValue(sxtype)==4 AND LastValue(cov4)==1 AND StaticVarGet(Name()+GetChartID()+"Cover4")==0 ) { AlertIF( LastValue(Cover), "EXEC " +url11, "", 4); StaticVarSet(Name()+GetChartID()+"Cover4",1); } else if (LastValue(Cover) != True) { StaticVarSet(Name()+GetChartID()+"Cover4",0); } if (LastValue(Cover)==True AND LastValue(sxtype)==4 AND LastValue(cov4)!=1 AND StaticVarGet(Name()+GetChartID()+"Cover5")==0 ) { AlertIF( LastValue(Cover), "EXEC " +url12, "", 4); StaticVarSet(Name()+GetChartID()+"Cover5",1); } else if (LastValue(Cover) != True) { StaticVarSet(Name()+GetChartID()+"Cover5",0); } bp1=NumToStr((ValueWhen(Buy,BuyPrice)),1.2,False); sp1=NumToStr(( ValueWhen(Sell,SellPrice)),1.2,False); shp=NumToStr(( ValueWhen(Short,ShortPrice)),1.2,False); cp=NumToStr( (ValueWhen(Cover,CoverPrice)),1.2,False); //////************** 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();