kite.holdings() does not return CNC positions

amit123
amit123 edited July 2020 in Python client
there seem to have been some changes in KITE.holdings() works. Now its a dictionary with 'day' and 'net' like positions. The keyword t1_quantity and opening_quantity have vanished.

But neither kite.holdings() nor kite.positions() is returning my CNC positions. It is only returning my overnight FNO positions.

  • sujith
    After the trade process, all your buy CNC positions will become holdings. The holdings response seems fine. Can you re-check and paste the response here?
  • sujith
    Make sure to run in debug mode and paste the complete stack trace. Remove all app and client-specific details as well.
  • amit123
    how to runt his in debug mode? There is no error which is thrown. I have changed my code to call KITE.holdings()['net'] instead of KITE.holdings() earlier.

    KITE.holdings() gives me the following (I have not over-ridden this method):

    it has 3 instruments. But I have 8 other equity in my holdings (on which no transaction was made today). They are not showing here. This was working fine until Friday. (modulo some code changes that have happened at your end which I mentioned above).

    {'net': [{'tradingsymbol': 'SIEMENS20JUL1200CE',
    'exchange': 'NFO',
    'instrument_token': 16018690,
    'product': 'NRML',
    'quantity': 13200,
    'overnight_quantity': 13200,
    'multiplier': 1,
    'average_price': 27.877083,
    'close_price': 33.8,
    'last_price': 45.95,
    'value': -367977.49559999997,
    'pnl': 238562.50440000003,
    'm2m': 160380.00000000006,
    'unrealised': 238562.50440000003,
    'realised': 0,
    'buy_quantity': 13200,
    'buy_price': 27.877083,
    'buy_value': 367977.49559999997,
    'buy_m2m': 446159.99999999994,
    'sell_quantity': 0,
    'sell_price': 0,
    'sell_value': 0,
    'sell_m2m': 0,
    'day_buy_quantity': 0,
    'day_buy_price': 0,
    'day_buy_value': 0,
    'day_sell_quantity': 0,
    'day_sell_price': 0,
    'day_sell_value': 0},
    {'tradingsymbol': 'ZEEL20JUL200CE',
    'exchange': 'NFO',
    'instrument_token': 17300738,
    'product': 'NRML',
    'quantity': 36000,
    'overnight_quantity': 36000,
    'multiplier': 1,
    'average_price': 6.425,
    'close_price': 4.05,
    'last_price': 4,
    'value': -231300,
    'pnl': -87300,
    'm2m': -1800,
    'unrealised': -87300,
    'realised': 0,
    'buy_quantity': 36000,
    'buy_price': 6.425,
    'buy_value': 231300,
    'buy_m2m': 145800,
    'sell_quantity': 0,
    'sell_price': 0,
    'sell_value': 0,
    'sell_m2m': 0,
    'day_buy_quantity': 0,
    'day_buy_price': 0,
    'day_buy_value': 0,
    'day_sell_quantity': 0,
    'day_sell_price': 0,
    'day_sell_value': 0},
    {'tradingsymbol': 'NELCO',
    'exchange': 'NSE',
    'instrument_token': 611329,
    'product': 'CNC',
    'quantity': 2000,
    'overnight_quantity': 0,
    'multiplier': 1,
    'average_price': 216.04174999999998,
    'close_price': 0,
    'last_price': 218.45,
    'value': -432083.49999999994,
    'pnl': 4816.500000000058,
    'm2m': 4816.500000000058,
    'unrealised': 4816.500000000058,
    'realised': 0,
    'buy_quantity': 2000,
    'buy_price': 216.04174999999998,
    'buy_value': 432083.49999999994,
    'buy_m2m': 432083.49999999994,
    'sell_quantity': 0,
    'sell_price': 0,
    'sell_value': 0,
    'sell_m2m': 0,
    'day_buy_quantity': 2000,
    'day_buy_price': 216.04174999999998,
    'day_buy_value': 432083.49999999994,
    'day_sell_quantity': 0,
    'day_sell_price': 0,
    'day_sell_value': 0}],
    'day': [{'tradingsymbol': 'NELCO',
    'exchange': 'NSE',
    'instrument_token': 611329,
    'product': 'CNC',
    'quantity': 2000,
    'overnight_quantity': 0,
    'multiplier': 1,
    'average_price': 216.04174999999998,
    'close_price': 0,
    'last_price': 218.45,
    'value': -432083.49999999994,
    'pnl': 4816.500000000058,
    'm2m': 4816.500000000058,
    'unrealised': 4816.500000000058,
    'realised': 0,
    'buy_quantity': 2000,
    'buy_price': 216.04174999999998,
    'buy_value': 432083.49999999994,
    'buy_m2m': 432083.49999999994,
    'sell_quantity': 0,
    'sell_price': 0,
    'sell_value': 0,
    'sell_m2m': 0,
    'day_buy_quantity': 2000,
    'day_buy_price': 216.04174999999998,
    'day_buy_value': 432083.49999999994,
    'day_sell_quantity': 0,
    'day_sell_price': 0,
    'day_sell_value': 0}]}
  • sujith
    This is positions response.
    You can check out readme to know how to enable debug logs.
Sign In or Register to comment.