PnL update delay

gokulasdf
kite api position book Pnl was not updating live.
  • sujith
    You can refer to this thread.
  • gokulasdf
    def calculate_total_return(dat):
    total_return = 0

    for trade_type in ["day"]:
    for trade in data[trade_type]:
    pnl = (trade['sell_value'] - trade['buy_value']) + (trade['quantity'] * trade['last_price'] * trade['multiplier'])
    total_return += pnl

    return total_return

    dat = kite.positions()
    total_return = calculate_total_return(dat)
    print("Total Return:", total_return)

    same pnl it didt update live
    it update pnl only whenever new order placed after it show same pnl not live
  • sujith
    You can go through the thread linked above to know the answer.
Sign In or Register to comment.