Zerodha - Number One Discount Broker in India

rrrajguru

Well-Known Member
After installing the Patch, chart is not working for me. No previous days datas. Only datas from opening time.
I had the same problem. Uninstalled Pi, downloaded the full setup from Q and installed again. Working fine now.
Me uninstalled, downloaded the full setup from Q and installed again. Still it did not work for me.

Again uninstalled, installed the old version. Working OK now.
 

Zerodha

Well-Known Member
BO order and After market order both shown in nBlack and also unselectable after installing the latest version of PI
anybody else facing similar issue.



edited image
If you have to place a bracket/amo, you have to select on the contract in the marketwatch and click on bracket or amo.

You can't click on F1/F2 and then change it to BO or AMO.
 

Zerodha

Well-Known Member
Can anyone help me fix the issue of multiple orders being fired every second from AmiBroker to Pi?
Here's the AFL I'm using:


The Lots variable comes from the strategy AFL.

Here's a Screenshot as well:
Use this to fire orders using the bridge. So replace the code from BRD=Null onwards

_SECTION_BEGIN("PiBridge_Zerodha");
EnableScript("vbscript");AmiPath = fdir( "C:\\Program Files (x86)\\Amibroker\\Broker.exe", 1 );
if (AmiPath==""){Path = "C:\\Program Files\\Amibroker\\";Sys = "Bit32"; }else {Path = "C:\\Program Files (x86)\\Amibroker\\";Sys = "Bit64";}
GfxSetBkMode(0);GfxSetTextColor( colorWhite );pxw = Status("pxwidth");pxh = Status("pxheight");Tikr = StrToUpper(Name());Val = StrToUpper("DAY");
BarB = BeginValue(BarIndex());BarE = EndValue(BarIndex());BarC = BarIndex();BarL = LastValue(BarC,1);BarT = BarIndex()-ValueWhen(TimeNum()==091500,BarIndex())+1;sym=TrdSym=Exch=ClientId=ORdType=ProdType="";Qty=0;
if (IsNull(fgetstatus("SymbolList.txt",1,4))){SymbolList = fopen( "SymbolList.txt", "w");if (SymbolList){fputs( "AmibrokerSymbol,TradeSymbol,Exchange,Qty,ClientID,OrderType,ProductType,Validity"+ "\n" +"EXAMPLE-I,EXAMPLE15MAYFUT,NFO,1,ABCD01,L,MIS,DAY" + "\n" , SymbolList );fclose(SymbolList);}}
Input = fopen( "SymbolList.txt", "r");if(Input){ while( ! feof(Input)){LineIn = fgets(Input);if (LineIN !=""){ if (StrToUpper(StrExtract(LineIn,0)) == Tikr){ Sym = StrToUpper(StrExtract(LineIn,0));TrdSym = StrToUpper(StrExtract(LineIn,1));Exch = StrToUpper(StrExtract(LineIn,2));Qty = StrToNum(StrExtract(LineIn,3));ClientId = StrToUpper(StrExtract(LineIn,4));OrdType = StrToUpper(StrExtract(LineIn,5));ProdType = StrToUpper(StrExtract(LineIn,6));}}}fclose( Input );}
DT = LastValue(DateNum(),1);TT = LastValue(TimeNum(),1);if (ORdType == "L")TrdPrice = LastValue(C,1);else TrdPrice = 0;
BuyVar = StaticVarGetText(Name()+"-Buy");BuyVar1 = Name()+"-Buy-"+NumToStr(DT,1.0)+"-"+NumToStr(TT,1.0)+"-"+NumToStr(GetChartID(),1.0);BuyL = LastValue(Buy);
SellVar = StaticVarGetText(Name()+"-Sell");SellVar1 = Name()+"-Sell-"+NumToStr(DT,1.0)+"-"+NumToStr(TT,1.0)+"-"+NumToStr(GetChartID(),1.0);SellL = LastValue(Sell);
ShortVar = StaticVarGetText(Name()+"-Short");ShortVar1 = Name()+"-Short-"+NumToStr(DT,1.0)+"-"+NumToStr(TT,1.0)+"-"+NumToStr(GetChartID(),1.0);ShortL = LastValue(Short);
CoverVar = StaticVarGetText(Name()+"-Cover");CoverVar1 = Name()+"-Cover-"+NumToStr(DT,1.0)+"-"+NumToStr(TT,1.0)+"-"+NumToStr(GetChartID(),1.0);CoverL = LastValue(Cover);
if (BuyL AND BuyVar != BuyVar1 AND Sym != ""){brd = CreateStaticObject("pibridge.Bridge");brd.PlaceOrder (Exch,TrdSym,StrLeft(Sym,10),"LONG",1,Qty,0,TrdPrice,0,ORdType,ProdType,ClientId,Val);}
if (CoverL AND CoverVar != CoverVar1 AND Sym != ""){brd = CreateStaticObject("pibridge.Bridge");brd.PlaceOrder (Exch,TrdSym,StrLeft(Sym,10),"EXIT SHORT",1,Qty,0,TrdPrice,0,ORdType,ProdType,ClientId,Val);}
if (SellL AND SellVar != SellVar1 AND Sym != ""){brd = CreateStaticObject("pibridge.Bridge");brd.PlaceOrder (Exch,TrdSym,StrLeft(Sym,10),"EXIT LONG",2,Qty,0,TrdPrice,0,ORdType,ProdType,ClientId,Val);}
if (ShortL AND ShortVar != ShortVar1 AND Sym != ""){brd = CreateStaticObject("pibridge.Bridge");brd.PlaceOrder (Exch,TrdSym,StrLeft(Sym,10),"SHORT",2,Qty,0,TrdPrice,0,ORdType,ProdType,ClientId,Val);}
GfxSelectFont( "Lucida Fax", 8.5, 700, False );GfxSetTextColor( colorGold );GfxTextOut("Coded by Choks",(pxw/2)-50,pxh-40);GfxTextOut("Mail Ur Feedback to [email protected]",(pxw/2)-130,pxh-30);
display = ParamToggle("Display Symbol Details","Yes|No",1);if(display==1){GfxTextOut("SYMBOL: " + sym,5,50);GfxTextOut("TRADE SYMBOL: " + Trdsym,5,70);GfxTextOut("EXCH: " + Exch,5,90);GfxTextOut("CLIENT ID: " + Clientid,5,110);GfxTextOut("PROD TYPE: " + prodtype,5,130);GfxTextOut("ORDER TYPE: " + ORdtype,5,150);GfxTextOut("QTY: " + WriteVal(Qty,1.0),5,170);}
if (sym == ""){GfxSelectFont( "Lucida Fax", 24, 700, False );GfxTextOut("Symbol Details Not Found in Text File",(pxw/2)-330,pxh/2);}
if ((sym != "" AND Exch == "NFO" AND StrRight(TrdSym,3)!= "FUT") OR (sym != "" AND Exch == "NSE" AND StrRight(TrdSym,2)!= "EQ") OR (sym != "" AND Exch == "MCX" AND StrRight(TrdSym,3)!= "FUT"))
{GfxSelectFont( "Lucida Fax", 24, 700, False );GfxTextOut("Trade Symbol MisMatch Check Symbol List File",(pxw/2)-370,pxh/2);}
Bridge = ParamTrigger("To Check Pi Bridge Connectivity !","Press Here");if (Bridge){brd = CreateStaticObject("pibridge.Bridge");}
Resetvar = ParamTrigger("To Reset Static Variables !","Press Here");if (ResetVar){StaticVarRemove("*");}DelSymbol = ParamTrigger("To Delete SymbolList File !","Press Here");if (DelSymbol){SymbolList = fopen( "SymbolList.txt", "w");
if (SymbolList){fputs( "AmibrokerSymbol,TradeSymbol,Exchange,Qty,ClientID,OrderType,ProductType,Validity"+ "\n" +"EXAMPLE-I,EXAMPLE15MAYFUT,NFO,1,ABCD01,L,MIS,DAY" + "\n" , SymbolList );fclose(SymbolList);}}
OpFolder = ParamTrigger("To Open Amibroker Directory!","Press Here");
<%
On Error Resume Next
OpFolder = AFL("OpFolder")
sys = AFL("Sys")
if OpFolder = 1 AND sys = "Bit32" then
CreateObject("Shell.Application").Open("C:\Program Files\Amibroker\")
elseif OpFolder = 1 AND sys = "Bit64" then
CreateObject("Shell.Application").Open("C:\Program Files (x86)\Amibroker\")
else
end if
%>

_SECTION_END();
 

columbus

Well-Known Member
@Zerodha,

How to change the default lots/quantity in BUY/SELL order to desired value
in PI? ( Of course ,do not suggest place order through QUICK ORDER)
 
Friends ! I am a little confused here .
My 60 day challenge page says I am +100/- . Whereas if I see P& L report says I am plus in F & O and minus in EQ .If I deduct F&O from EQ = -200/- .
1.So which report should I take ? 60 day page or the P & L page ? or
should I earn another 300/- to make it really +100/-
2. Is the 60 days inclusive of the last date mentioned in that ?
3.Even if I am +100/- will I get back all the brokerage for the entire 60 day period ?
Thanks in advance .
 

Similar threads