//////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// _SECTION_BEGIN("New Chart"); barcolor = ((IIf(C>O,colorGreen,colorRed))); SetBarFillColor(barcolor); Plot( C, "Price", barcolor, styleCandle ); GfxSelectFont( "Tahoma", 11, 110 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorWhite ); SetChartOptions(0,chartShowArrows|chartShowDates); SetBarsRequired(sbrAll,sbrAll); GraphXSpace=10; GfxSelectPen( colorGreen, 2 ); GfxSelectSolidBrush( colorDarkTeal); GfxRectangle( 3, 2, 1580, 53 ); GfxSelectFont( "Tahoma", 12, 350 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBrightGreen ); GfxTextOut(""+Interval(2),30,15); GfxSetTextColor(colorred ); GfxTextOut(" "+DateTimeToStr(SelectedValue(DateTime())),30*4.5,15); GfxSetTextColor( colorAqua ); GfxTextOut("Open = "+open,30*12.5,15); GfxSetTextColor( colorbrightGreen ); GfxTextOut("High = "+high,30*18,15); GfxSetTextColor( colorRed ); GfxTextOut("Low = "+low,30*23.5,15); GfxSetTextColor( colorYellow ); GfxTextOut("Close = "+close,30*30,15); GfxSetTextColor( colorTurquoise ); GfxTextOut("ROC % = "+Prec(SelectedValue( ROC( C, 1 ) ),2),30*36,15); GfxSetTextColor( colorOrange ); GfxTextOut("Volume = "+Volume,30*44,15); //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// _SECTION_BEGIN("Intraday Timing Condition"); YFirstTradeTime = ParamTime( "Start Time", "09:15" ); // Earliest time to take a trade YLastTradeTime = ParamTime( "End Time", "15:00" ); // Latest time to take new trades YExitAllPositionsTime = ParamTime( "Exit Time", "15:10" ); // Exit all trades YEntrytimecondition = (TimeNum() >= YFirstTradeTime AND TimeNum() <= YLastTradeTime ); Exittimecondition = Cross(TimeNum(),YExitAllPositionsTime); _SECTION_END(); dn = Day(); newday = dn != Ref( dn, -1 ); bar=BarsSince(newday); _SECTION_END(); a = StrToNum(""+H ); b = StrToNum(""+L ); _SECTION_BEGIN("Segment"); Option = ParamToggle("Option or Equity","EQ|Option",0); _SECTION_BEGIN("Option Setting"); SPot = ParamStr("Spot Symbol Name","BANKNIFTY"); SYm_Round = Param("Round of value for OPT",100,5,100,5); CE_interval = Param("CALL Strike Interval",0,0,10000,100); PE_interval = Param("PUT Strike Interval",0,0,10000,100); //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// _SECTION_BEGIN("Pivot High Low"); Manual = ParamToggle("Manual or ORB High/Low","Manual|ORB" ,1); Mhigh = Param("Manual High",a,0,100000,0.01); Mlow = Param("Manual low",b,0,100000,0.01); FTTT = ParamTime( "RANGE_START_TIME", "09:15:00" ); ORBIMEE = ParamTime( "RANGE_BREAKOUT_TIME", "09:29:59" ); HH = HighestSince(TimeNum()<=FTTT, H, 1); LL = LowestSince(TimeNum()<=FTTT, L, 1); if(Manual) { ORBHigh = ValueWhen(TimeNum()<=ORBIMEE, HH, 1); ORBLow = ValueWhen(TimeNum()<=ORBIMEE, LL, 1); } else { ORBHigh = Mhigh; ORBLow = Mlow; } "ORBHigh="+ORBHigh; "ORBLow="+ORBLow; Range = ORBHigh- ORBLow; //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// _SECTION_END(); ////////////Fibo Retracement ///////////// _SECTION_BEGIN("Entry Buffer"); Buffer = Param("Entry Buffer %",0,0.01,100,0.01)/100; numbars = LastValue(Cum(Status("barvisible"))); hts = -33.5; R=Range;//range P=ORBLow; pI = LastValue (p,1); fr2 = p + (R * 0.214); fr2I = LastValue (fr2,1); fs1 = (p - (R * .272)) * (1-Buffer); fs1I = LastValue (fs1,1); fs2 = (p - (R * .618)) * (1-Buffer); fs2I = LastValue (fs2,1); fs3 = p - (R * 1); fs3I = LastValue (fs3,1); Plot(p,"Pivot",colorBlue,styleDots|styleNoLine|styleNoRescale); Plot(fr2,"R2",colorPink,styleDots|styleNoLine|styleNoRescale); Plot(fs1,"S1",colorGreen,styleDots|styleNoLine|styleNoRescale); Plot(fs2,"S2",colorLime,styleDots|styleNoLine|styleNoRescale); Plot(fs3,"S3",colorRed,styleDots|styleNoLine|styleNoRescale); PlotText(" TP 1 ", LastValue(BarIndex())-(numbars/Hts), pI, colorBlue); PlotText(" TP 2 " , LastValue(BarIndex())-(numbars/Hts), fr2I, colorPink); PlotText(" Buy 1 " , LastValue(BarIndex())-(numbars/Hts), fs1I, colorGreen); PlotText(" Buy 2 " , LastValue(BarIndex())-(numbars/Hts), fs2I, colorLime); PlotText(" Initial SL " , LastValue(BarIndex())-(numbars/Hts), fs3I, colorRed); _SECTION_END(); _SECTION_BEGIN("Target 2 On|OFF"); TG=ParamToggle("Target 2 Enable","NO|YES",1); //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// _buy = (Cross( fs1,L) OR (O > fs1 AND L < fs1 )) AND YEntrytimecondition; Bbar = Sum(_buy,(bar+1)); _Buy1 = (Cross( fs2,L) OR (O > fs2 AND L < fs2 )) AND YEntrytimecondition; _Buy11 = Sum(_buy1,(bar+1)); Buy = Sell = Short = Cover = TSL = Null; BF1=BF2=0; LongFlag = ShortFlag = Target = _BuyPrice = ShortTarget = Target1=Stoploss1=0; //Simple flags Starget= sstoploss = BTflag=LF=btf=bt=BSL=Stoploss=BT1=BF11=BF22=Bp =0; //Using Loop to generate signals for( i = 0; i < BarCount; i++ ) { /////////////////////////////////////////Long Positions if( _Buy[ i ] AND LongFlag == 0 AND Bbar[i] <2 AND BTflag==0) { Buy[ i ] = 1; BuyPrice[i]=fs1[i]; _BuyPrice = fs1[i]; LongFlag = 1; BF1=1; } if( _Buy1[ i ] AND LongFlag == 1 AND _Buy11[i] <2 AND BTflag==0) { Buy[ i ] = 1; _BuyPrice = fs1[i]; LongFlag = 2; BF2=1; } if( LongFlag == 1 OR LongFlag == 2) { Target = p[i] ; Target1 = fr2[i]; } if( LongFlag == 1 OR LongFlag == 2) { if(BF2==1 AND TG[i] /*AND H[i] > Target[i]*/ AND BTflag>0) { Stoploss = fs1[i]; } else Stoploss = fs3[i]; //if(BTflag>0 AND TG[i] AND BF2==1) //{ // Stoploss = fs1[i]; //} } //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// if( (LongFlag>0) AND High[i]>Target AND BF1==1 ) { Sell[ i ] = 1; SellPrice[i] = Target[i]; if(TG[i] AND BF2 >0 ) { LongFlag = 1; BTflag=1; }else { LongFlag = 0; } BF1=0; } if( (LongFlag==1) AND High[i]>Target1[i] AND TG[i] AND BTflag>0 AND BF2 >0) { Sell[ i ] = 1; SellPrice[i] = Target[i]; LongFlag = 0; BTflag=0; BF2=0; } //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// if((LongFlag==1 OR LongFlag==2) AND c[i-1] < stoploss[i]) { Sell[ i ] = 1; SellPrice[i] = stoploss[i]; LongFlag = 0; BTflag=0; BF1=BF2=0; } if((LongFlag==1 OR LongFlag==2) AND Exittimecondition[i]) { Sell[ i ] = 1; SellPrice[i] = Open[i]; LongFlag = 0; BTflag=0; BF1=BF2=0; } //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// BT[i] = Target[i]; BT1[i] = Target1[i]; BSL[i]= stoploss[i]; LF[i] = Longflag[i]; BTF[i] = Btflag[i]; BF11[i] = BF1[i]; BF22[i] = BF2[i]; BP[i] = _BuyPrice[i]; } //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// Buyflag = Flip(Buy,Sell); Shortflag11 = Flip(Short,cover); //Plot(IIf(Buyflag,BT,Null),"",colorAqua,styleDashed); 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 , shapeDownTriangle, shapeNone ), colorRed, 0, H+10, Offset = -45 ); 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 , shapeUpArrow, shapeNone ), colorBlue, 0, L, Offset = -45 ); if(Option) { Strike_CE = fs1 ; Strike_PE = fs1 ; CE_Round =(round((Strike_CE)/SYm_Round)*SYm_Round)+CE_interval; PE_Round =(round((Strike_PE)/SYm_Round)*SYm_Round)+PE_interval; CE_Symbol = SPot+""+CE_Round+"CE" ; PE_Symbol = SPot+""+PE_Round+"PE" ; //GfxTextOut( ""+CE_Symbol,30,80); } if(Option) { sym = CE_Symbol; } else sym = Name(); //////************** By Easyalgo.in *************////// ////// +91-8448735946, Support@easyalgo.in /////////// //***************************************************// //Risk = Param("Captital for qty",100000,1000,10000000,1); eqty1 = Param("Qty 1",100,1000,10000000,1);// round(Risk/fs1); eqty2 = Param("Qty 2",100,1000,10000000,1);//round(Risk/fs2); qty = IIf(BF11 AND NOT BF22,eqty1,IIf( BF11 AND BF22 ,eqty2, eqty1)); xqty = IIf(BF11 AND Bf22==0 , eqty1,IIf(BF11 AND BF22 AND TG==0, eqty1+eqty2,IIf(BF11 AND BF22 AND TG AND BTF==0,eqty1+eqty2,IIf( BF22 AND TG AND BF11==0 ,eqty1,IIf(BF22 AND TG AND BTF==1,eqty2,eqty1))))); buyflag = Flip(Buy,Sell AND BF22==0); "buyflag = "+buyflag ; lf1 = WriteIf(buyflag==1,"T","F"); plt = ParamToggle("PLot ","NO|YES",1); if(plt AND LF1=="T"){ GfxSetTextColor(colorBrightGreen); GfxSelectPen(colorGreen,2); GfxSelectSolidBrush(colorDarkTeal); GfxRectangle(5,53,220,260); GfxSelectFont( "Tahoma", 11, 350 ); GfxSetBkMode( 1 ); GfxSetTextColor( colorBrightGreen ); GfxTextOut("Entry = "+Prec(BP,2),15,70); GfxTextOut("Target 1 = "+Prec(bt,2),15,105); GfxTextOut("Target 2 = "+Prec(bt1,2),15,135); GfxTextOut("Stoploss = "+Prec(bsl,2),15,165); GfxTextOut("Entry Qty = "+Prec(qty,2),15,195); GfxTextOut("Exit Qty = "+Prec(xqty,2),15,225); _SECTION_BEGIN("NMN Chart Stamp"); SetFormulaName("NMN Chart Stamp"); GfxFont = "TAHOMA"; GfxSetOverlayMode(0); GfxSelectFont(GfxFont, Status("pxheight")/48); GfxSetTextAlign(6); // center alignment GfxSetTextColor(colorBrightGreen); GfxSetBkMode(0); // transparent GfxTextOut(sym, Status("pxwidth")/2, Status("pxheight")/12); GfxSelectFont(GfxFont, Status("pxheight")/28); GfxSelectFont(GfxFont, Status("pxheight")/18); GfxSelectFont("Tahoma", Status("pxheight")/36); _SECTION_END(); } if(plt AND LF1=="F" ){ GfxFont = "TAHOMA"; GfxSetOverlayMode(0); GfxSelectFont(GfxFont, Status("pxheight")/48); GfxSetTextAlign(6); // center alignment GfxSetTextColor(colorBrightGreen); GfxSetBkMode(0); // transparent GfxTextOut("NO TRADE", Status("pxwidth")/2, Status("pxheight")/12); GfxSelectFont(GfxFont, Status("pxheight")/28); GfxSelectFont(GfxFont, Status("pxheight")/18); GfxSelectFont("Tahoma", Status("pxheight")/36); //GfxTextOut("No Trade",700,70); } //////************** 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();