☰
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
10.9K
All Categories
64
Node JS client
21
Go client
641
.Net API client
311
Kite Publisher
512
.Net / VBA / Excel (3rd party)
336
Algorithms and Strategies
828
Java client
831
API clients
367
PHP client
2.9K
Python client
296
Mobile and Desktop apps
1.1K
Market data (WebSockets)
2.7K
General
In this Discussion
May 5
SRIJAN
kite.position is not giving latest data
rohitka07
May 5
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 5
edited May 5
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.