position data is wrong

iamgopal1213
iamgopal1213 edited August 2023 in General
{'tradingsymbol': 'BANKNIFTY2381045300PE', 'exchange': 'NFO', 'instrument_token': 12126978, 'product': 'MIS', 'quantity': 45, 'overnight_quantity': 0, 'multiplier': 1, 'average_price': 435.925, 'close_price': 0, 'last_price': 452.6, 'value': -19397.25, 'pnl': 969.75, 'm2m': 969.75, 'unrealised': 969.75, 'realised': 0, 'buy_quantity': 60, 'buy_price': 435.925, 'buy_value': 26155.5, 'buy_m2m': 26155.5, 'sell_quantity': 15, 'sell_price': 450.55, 'sell_value': 6758.25, 'sell_m2m': 6758.25, 'day_buy_quantity': 60, 'day_buy_price': 435.925, 'day_buy_value': 26155.5, 'day_sell_quantity': 15, 'day_sell_price': 450.55, 'day_sell_value': 6758.25}

above is a position data, as you can see, realised profit is zero while, there are some buy and sell happened, so it should not be zero,
from documentation realised is , float64 and which gives Realised intraday returns

Tagged:
  • sujith
    It is a legacy field, use P&L formula for calculation pnl = (sellValue - buyValue) + (netQuantity * lastPrice * multiplier);
  • iamgopal1213
    Yes, that result is already given in the field pnl, m2m and unrealised, but current pnl have two component, one is of previous buy sell orders which already happened, and current position profit which is unrealised,
Sign In or Register to comment.