kite.position is not giving latest data

rohitka07
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('###########################')
Sign In or Register to comment.