Skip to main content

Positions Book

retrieves the overnight and day positions as a list. Request to be POSTed to uri : /NorenWClientAPI/PositionBook

Request Details :

Parameter NamePossible valueDescription
jData*Should send json object with fields in below list
Json FieldsPossible valueDescription
uid*Logged in User Id
actid*Account id of the logged in user.

Example:

curl --location 'https://api.kambala.co.in/NorenWClientAPI/PositionBook' \
--header 'Content-Type: text/plain' \
--header 'Authorization: Bearer e5821f3f8b905f00ce2d4a1daa4fcc68cfeb4bf2f93a6263ca3db2a7ecac8e3a' \
--data 'jData={"uid":"DEMO","actid":"DEMO"}'

Response Details :

Response data will be in json format with Array of Objects with below fields in case of success.

Json FieldsPossible valueDescription
statOk or Not_OkPosition book success or failure indication.
uidUser Id
actidAccount Id
exchExchange segment
tsymTrading symbol / contract.
s_prdt_aliProduct display name
prdProduct name to be shown.
tokenContract token
symnameSymbol name
instnameInstrument Name
cnameBroker specific contract display name, present only if applicable.
frzqtyFreez Quantity
ppPrice precision
lsLot size
tiTick size
multContract price multiplier, (used for order value calculation)
prcftrgn*pn/(gd*pd).
daybuyqtyDay Buy Quantity
daysellqtyDay Sell Quantity
daybuyamtDay Buy Amount
daybuyavgprcDay Buy average price
daysellamtDay Sell Amount
daysellavgprcDay buy average price
cfbuyqtyCarry Forward Buy Quantity
cfsellqtyCarry Forward Sell Quantity
cfbuyamtCarry Forward Buy Amount
cfbuyavgprcCarry Forward Buy average price
cfsellamtCarry Forward Sell Amount
cfsellavgprcCarry Forward Buy average price
cforgavgprcOriginal Avg Price
openbuyqtyOpen Buy Quantity
opensellqtyOpen Sell Quantity
openbuyamtOpen Buy Amount
openbuyavgprcOpen Buy Average Price
opensellamtOpen Sell Amount
opensellavgprcOpen Sell Average Price
dayavgprcDay average price
netqtyNet Position quantity
netavgprcNet position average price
upldprcUpload price
netupldprcNet Upload Price
lpLTP
urmtomUnrealizedMTOM.(Can be recalculated in LTP update (Can be recalculated in LTP update : = netqty * (lp from web socket - netavgprc) * prcftr
bepBreak even price
totbuyamtTotal buy amount
totsellamtTotal sell amount
instnameInstrument Name
totbuyavgprcTotal buy average price
totsellavgprcTotal sell avrage price
rpnlRealizedPNL
NOTE: calculation of MTM and PnL
1.ActualUnrealizedMtoM= netqty(in weights) * prcftr * mult * (LTP - avgprc)
For MTM, avgprc = netavgprc;
For PnL, avgprc = netupldprc; if netupldprc = 0 then avgprc = netavgprc;

2.NetBuyQty = daybuyqty + cfbuyqty;
3.NetSellQty = daysellqty + cfsellqty;

4.ActualSellAvgPrice
if (NetSellQty != 0) {
ActualSellAvgPrice = ((daysellamt / mult) +(upldprc * prcftr * cfsellqty)) /NetSellQty;
} else
ActualSellAvgPrice = 0.0;
5.ActualBuyAvgPrice
if (NetBuyQty != 0) {
ActualBuyAvgPrice = ((daybuyamt / mult) +(upldprc * prcftr * cfbuyqty)) /NetBuyQty;
} else
ActualBuyAvgPrice = 0.0;



6.ActualBookedPNL
if (netqty(in weights) > 0) {
ActualBookedPNL = (ActualSellAvgPrice - ActualBuyAvgPrice) * NetSellQty * mult;
} else {
ActualBookedPNL = (ActualSellAvgPrice - ActualBuyAvgPrice) * NetBuyQty * mult;
}
7.MTM =rpnl + ActualUnrealizedMtoM

8.PnL=ActualBookedPNL + ActualUnrealizedMto

Response data will be in json format with below fields in case of failure:

Json FieldsPossible valueDescription
statNot_OkPosition book request failure indication.
request_timeResponse received time.
emsgError message

Sample Success Response :

[
{
"stat": "Ok",
"uid": "DEMO",
"actid": "DEMO",
"exch": "NSE",
"tsym": "SUZLON-EQ",
"s_prdt_ali": "CNC",
"prd": "C",
"token": "12018",
"symname": "SUZLON",
"instname": "EQ",
"cname": "SUZLON ENERGY LIMITED",
"frzqty": "1891775",
"pp": "2",
"ls": "1",
"ti": "0.01",
"mult": "1",
"prcftr": "1.000000",
"daybuyqty": "1",
"daysellqty": "0",
"daybuyamt": "53.35",
"daybuyavgprc": "53.35",
"daysellamt": "0.00",
"daysellavgprc": "0.00",
"cfbuyqty": "0",
"cfsellqty": "0",
"cfbuyamt": "0.00",
"cfbuyavgprc": "0.00",
"cfsellamt": "0.00",
"cfsellavgprc": "0.00",
"openbuyqty": "0",
"opensellqty": "0",
"openbuyamt": "0.00",
"openbuyavgprc": "0.00",
"opensellamt": "0.00",
"opensellavgprc": "0.00",
"dayavgprc": "53.35",
"netqty": "1",
"netavgprc": "53.35",
"upldprc": "0.00",
"netupldprc": "53.35",
"lp": "53.35",
"urmtom": "0.00",
"bep": "53.35",
"totbuyamt": "53.35",
"totsellamt": "0.00",
"totbuyavgprc": "53.35",
"totsellavgprc": "0.00",
"rpnl": "-0.00"
}
]

Sample Failure Response :

{
"stat":"Not_Ok",
"emsg":"Session Expired : Invalid Session Key"
}