Hi, Using python client, when I try to convert the MIS position to CNC, I get "*** kiteconnect.exceptions.InputException: Missing or empty field `exchange`" error. I have verified all values are present and I also updated the client to the latest version.
``` if "MIS" == position['product'] and position['quantity'] > 0: pdb.set_trace() kite.convert_position( exchange=kite.EXCHANGE_NSE, tradingsymbol=position['tradingsymbol'], transaction_type=kite.TRANSACTION_TYPE_BUY, position_type=kite.VALIDITY_DAY, quantity=position['quantity'], old_product=kite.PRODUCT_MIS, new_product=kite.PRODUCT_CNC ) ```
Version details: ``` Name: kiteconnect Version: 3.9.0 Summary: The official Python client for the Kite Connect trading API Home-page: https://kite.trade Author: Zerodha Technology Pvt ltd. (India) Author-email: [email protected] License: MIT Location: d:\work\bash_config\.conda\envs\algo\lib\site-packages Requires: pyOpenSSL, six, python-dateutil, requests, pywin32, autobahn, service-identity, enum34 Required-by:
You can go through this thread.
I am already using the latest version of the kiteconnect.
Below is the result:
But the convert_position still fails
We are checking this.
There are few issues coming up while releasing this version. We are checking on this.
This is fixed. You can upgrade to the latest version using
pip install --upgrade kiteconnect
and try the position_convertion method call.but there was one issue..
I had to hard code the 'day' value instead of a constant.
position_type='day', #kite.VALIDITY_DAY,
You don't need to. You can use
POSITION_TYPE_DAY
constant. Check this assignment.