GTT placed by python client failing to execute sell

vishalnigam20
I placed GTT via python client, it is placing the GTT correctly but failed to execute sell with an error Invalid `product`. despite all the parameters are right entered.


eg
//stock created by kite.orders() placed.

tradingsymbol = stock.get('tradingsymbol')
buy_price = stock.get('average_price')
last_price = stock.get('average_price')
status = kite.place_gtt(
tradingsymbol = tradingsymbol,
exchange= kite.EXCHANGE_NSE,
trigger_values=[round(last_price*0.95,1),round(last_price*1.05,1)],
last_price=last_price,
orders= [{'transaction_type': kite.TRANSACTION_TYPE_SELL,'quantity':stock.get('quantity'),'order_type' : kite.ORDER_TYPE_LIMIT,
'product' : tradingsymbol, 'price' : round(buy_price*0.95,1)},
{'transaction_type': kite.TRANSACTION_TYPE_SELL,'quantity':stock.get('quantity'),'order_type' : kite.ORDER_TYPE_LIMIT,
'product' : tradingsymbol, 'price' : round(buy_price*1.05,1)}],
trigger_type= kite.GTT_TYPE_OCO)
  • vishalnigam20
    I can provide GTT ids if required.
  • sujith
    Can you private message gtt id and client id?
  • vishalnigam20
    @sujith Thanks for responding. I have sent the details in a message.
  • rakeshr
    {'transaction_type': kite.TRANSACTION_TYPE_SELL,'quantity':stock.get('quantity'),'order_type' : kite.ORDER_TYPE_LIMIT,
    'product' : tradingsymbol, 'price' : round(buy_price*0.95,1)}
    You are using wrong product type for orders, it should be CNC or NRML not tradingsymbol. You can check all input param detail here.
  • vishalnigam20
    nice catch @rakeshr . this could be the reason. I checked one of my existing gtt and found this. 'tradingsymbol': 'BHEL', 'product': 'BHEL',.

    Interestingly gtt was created successfully.
  • sujith
    GTT API doesn't have this kind of validation. Currently, it is done on frontend apps. We will try to include it in the future.
Sign In or Register to comment.