get_gtts call does not return tag

sudhirtambe
if place_gtt accept orders, which include tag field.
then, get_gtts should also return tag field.
Tagged:
  • sujith
    @sudhirtambe,
    The order tags are not supported while placing a GTT.
  • sudhirtambe
    sudhirtambe edited July 2020
    tag is supported for GTT order, see working code snippet below. I am able to retrieve the tag through ticker as well when GTT is triggered & executed. So tag is functional in all aspect, except when get_gtts() is invoked.

    #InsertKiteOrder.py
    if jsonOrdData['trigger_type']: #Indicates OCO Order
    lstTriggers.insert(0, jsonOrdData['slPrice'])
    lstOrders.insert(0, {'transaction_type':jsonOrdData['transaction_type'], 'quantity' :jsonOrdData['quantity'],
    'price':jsonOrdData['slPrice'], 'order_type':orderType, 'product':product ,'tag':jsonOrdData['tag']})
    trigger_type = KiteConnect.GTT_TYPE_OCO
    print(f'lstTriggers: {lstTriggers}')
    print(f'New lstOrders: {lstOrders}')
    kite = KiteSingleton.get_instance()
    ordId = kite.place_gtt(trigger_type=trigger_type, tradingsymbol=jsonOrdData['tradingsymbol'], exchange=jsonOrdData['exchange'],
    last_price=last_price,trigger_values=lstTriggers, orders = lstOrders)


    #TickerDAO.py
    if data['status'] == "COMPLETE": # or data['status'] == "CANCELLED":
    print(f"status:{data['status']}\norder:{data}")
    try:
    TradeDAO.insertKiteMultiTrades(data['order_id'], data['tag'])
  • rhnvrm
    Hey

    Currently we don't support tag in GTT, and we may consider supporting it at a later date.

    At the moment, even the python api docs do not mention tag. (https://github.com/zerodhatech/pykiteconnect/blob/b00a4b56581a50586d3139c204c72de317913c5c/kiteconnect/connect.py#L718). To clarify, I think you are getting confused with the order api, which supports it. The order expected in GTT is not the same as that.
Sign In or Register to comment.