☰
Login
Signup
Home
›
Python client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.9K
All Categories
0
Incidents
156
Node JS client
40
Go client
793
.Net API client
380
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
347
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
November 2017
palani_kmp
November 2017
sujith
need to know pending quantity
palani_kmp
November 2017
in
Python client
Hi,
I place the limit order of RELIANCE and I would like to know when all my mentioned quantity(1000) completely traded?
--------------------------------
r = requests.get('
https://api.kite.trade/instruments/NSE/RELIANCE?api_key=myapi&access_token=mytoken'
)
p = requests.get("
https://api.kite.trade/orders/151220000000000?api_key=myapi&access_token=token
")
pjson=p.json()
pendin=pjson['data'][0]['pending_quantity']
print("pending Quantity",pendin)
------------------------------
But I am getting error.kindly help to know pending quantity of my placed trade
sujith
November 2017
edited November 2017
Hi
@palani_kmp
,
You can use
postbacks
and check out
example
.
The Kite will send postback after an order is executed.
palani_kmp
November 2017
Thanks. However I would want get by python code. Will below code work?
pending_ord= requests.get("
https://api.kite.trade/orders?api_key=myapi&access_token=token
")
pendjson=pending_ord.json()
pendquan=pendjson['data'][0]['pending_quantity']
print("Pending Quantity",pendquan)
sujith
November 2017
Hi,
This code looks fine. It should work but it is very bad practice to poll orderbook. Your other requests might get blocked with status 429(too many requests).
I would suggest using postbacks.
palani_kmp
November 2017
I am not sure , how to do this, can you provide some sample code??pls
sujith
November 2017
You can check out example for postbacks
here
.
palani_kmp
November 2017
Thanks.I have done it.you may close my request.
This discussion has been closed.
You can use postbacks and check out example.
The Kite will send postback after an order is executed.
pending_ord= requests.get("https://api.kite.trade/orders?api_key=myapi&access_token=token")
pendjson=pending_ord.json()
pendquan=pendjson['data'][0]['pending_quantity']
print("Pending Quantity",pendquan)
This code looks fine. It should work but it is very bad practice to poll orderbook. Your other requests might get blocked with status 429(too many requests).
I would suggest using postbacks.