☰
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
996
Java client
1.1K
API clients
404
PHP client
4K
Python client
346
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
May 2022
SRIJAN
kite.position is not giving latest data
rohitka07
May 2022
in
Python client
I'm executing below code on python client Pycharm every 1 second. This is not giving latest Last price and latest PNL. IS there an issue with this API? Tried with 5 seconds/10seconds interval as well. But no luck.
position = kite.positions()
print(position)
position = position['day']
open_position = position[0]
quantity = open_position['quantity']
tradingsymbol = open_position['tradingsymbol']
instrument_token = open_position['instrument_token']
average_price = open_position['average_price']
pnl = open_position['pnl']
last_price = open_position['last_price']
print('quantity = ' + str(quantity))
print('tradingsymbol = ' + str(tradingsymbol))
print('instrument_token = ' + str(instrument_token))
print('average_price =' + str(average_price))
print('last_price = ' + str(last_price))
print('pnl = ' + str(pnl))
print('###########################')
Tagged:
intraday positions
positions
net positions
SRIJAN
May 2022
edited May 2022
https://kite.trade/forum/discussion/3166/getposition-is-not-having-updated-value
It's not recommended to poll positions for just pnl.
You have to get ltp from websocket/ quote and update pnl at your end.
Sign In
or
Register
to comment.
It's not recommended to poll positions for just pnl.
You have to get ltp from websocket/ quote and update pnl at your end.