Unable to Place GTT orders

Gafoor
HI,

I am trying to use GTT orders but getting error.
kite.get_gtts()


'KiteConnect' object has no attribute 'get_gtts'
  • sujith
    Can you private message your api_key? We will check and get back to you.
  • Gafoor
    Hi @sujith

    I am trying to place GTT order

    trigger_type = kite.GTT_TYPE_OCO
    tradingsymbol = "IDEA"
    exchange = "NSE"
    trigger_values = [3, 6]
    trading_instrument = exchange + ":" + tradingsymbol
    price_dict = kite.ltp(trading_instrument)
    price = price_dict[trading_instrument]["last_price"]
    order_dict = {"transaction_type": "SELL" , "quantity": 1}
    kite.place_gtt(trigger_type = trigger_type, tradingsymbol = tradingsymbol, exchange = exchange, trigger_values =trigger_values, last_price=price, orders=order_dict)

    this code is giving me :-
    InputException: `quantity` missing inside orders


  • sujith
    If you are placing two triggers then you need to have two orders on the list.
    You can check out the documentation here.
  • Rajneesh_12
    @Gafoor
    The code that you use means it will buy at "price" and sell at any one of the triggers right?
  • sujith
    It will place a limit order when the trigger is hit. You can see the behavior of OCO GTT on the Kite web.
Sign In or Register to comment.