Kite Order - Trying to pass Exchange

kiteapi
Here is the code:

exchange = "NSE"
kiteExchange = "kite.EXCHANGE_" + exchange
kiteExchange = str(kiteExchange)
print(type(kiteExchange))
print(kiteExchange)
print("kite.EXCHANGE_NSE")

id = kite.place_order(
tradingsymbol=symbol,
exchange=kiteExchange,
transaction_type=kite.TRANSACTION_TYPE_SELL,
quantity=quantity,
price=price,
order_type=kite.ORDER_TYPE_LIMIT,
product=kite.PRODUCT_MIS,
variety=kite.VARIETY_REGULAR,
)
return id

As you can see I am trying to pass exchange, but errors out saying:


kite.EXCHANGE_NSE
kite.EXCHANGE_NSE
Traceback (most recent call last):

Error:
kiteconnect.exceptions.InputException: Invalid `exchange`.

If I pass the exact string "kite.EXCHANGE_NSE" that works fine. I have tried to see what is wrong for quite some time, made sure the type is str, but still errors out.
Tagged:
  • sujith
    Can you run in debug mode and paste the complete stack trace here?
    Make sure to remove the app and client-specific details.
Sign In or Register to comment.