Quotes and position data differs

kakya
this is this the data which i noted at same time
Quotes :
[{'tradingsymbol': 'FSL', 'instrument_token': 3661825, 'last_price': 195.05, 'open': 200.0, 'high': 201.0, 'low': 192.7, 'close': 202.9, 'volume': 3369264, 'change': -7.85, 'change_per': -3.87, 'buy_ordres': [{'price': 195.05, 'quantity': 29, 'orders': 2}, {'price': 195, 'quantity': 789, 'orders': 16}, {'price': 194.95, 'quantity': 497, 'orders': 7}, {'price': 194.9, 'quantity': 951, 'orders': 7}, {'price': 194.85, 'quantity': 2706, 'orders': 7}], 'sell_orders': [{'price': 195.2, 'quantity': 598, 'orders': 4}, {'price': 195.25, 'quantity': 49, 'orders': 2}, {'price': 195.3, 'quantity': 319, 'orders': 5}, {'price': 195.35, 'quantity': 2949, 'orders': 7}, {'price': 195.4, 'quantity': 704, 'orders': 7}], 'sell_quantity': 1013172, 'buy_quantity': 578563}]

Position:
{'tradingsymbol': 'FSL', 'exchange': 'NSE', 'instrument_token': 3661825, 'product': 'CO', 'quantity': 1, 'overnight_quantity': 0, 'multiplier': 1, 'average_price': 195.2, 'close_price': 0, 'last_price': 194.7, 'value': -195.2, 'pnl': -0.5, 'm2m': -0.5, 'unrealised': -0.5, 'realised': 0, 'buy_quantity': 1, 'buy_price': 195.2, 'buy_value': 195.2, 'buy_m2m': 195.2, 'sell_quantity': 0, 'sell_price': 0, 'sell_value': 0, 'sell_m2m': 0, 'day_buy_quantity': 1, 'day_buy_price': 195.2, 'day_buy_value': 195.2, 'day_sell_quantity': 0, 'day_sell_price': 0, 'day_sell_value': 0}

if you check the last_price it has huge diff. Not just last_prise pnl also (I dint verify others) Why this is so ? is this a bug ?
Can you fix this please because my algorithm used position to calculate stop loss and modify the order, and due to this difference whole calculations are getting wrong.

Tagged:
This discussion has been closed.