invalid instrument in place_gtt even with corrrect trading_symbol

asto
asto edited January 2023 in Python client
@rakeshr ,@sujith
I was just trying gtt.. have been receiving "invalid instrument" for different instruments ( which have been picked from kite.instruments) <code>
ORDER= [
{
"exchange":"NSE",
"tradingsymbol": "SBIN",
"transaction_type": kite.TRANSACTION_TYPE_SELL,
"quantity": 1,
"order_type": "LIMIT",
"product": "CNC",
"price": 587
},
{
"exchange":"NSE",
"tradingsymbol": "SBIN",
"transaction_type": kite.TRANSACTION_TYPE_SELL,
"quantity": 1,
"order_type": "LIMIT",
"product": "CNC",
"price": 602
}]
trigger_id = kite.place_gtt(trigger_type=kite.GTT_TYPE_OCO,
tradingsymbol='NIFTY20OCTFUT', exchange='NFO', trigger_values=[587,602],
last_price=600,orders=ORDER)


( i dont have a existing position for the given instrument is that the problem)

what have been going wrong over here ,can anyone help plz
  • rakeshr
    trigger_id = kite.place_gtt(trigger_type=kite.GTT_TYPE_OCO,
    tradingsymbol='NIFTY20OCTFUT',
    You are using an expired tradingsymbol in the condition parameter. Go through the python gtt example here.
  • asto
    thanks @rakeshr and sorry for not seeing the typo
    @rakeshr i had a doubt regarding web socket
    is it guaranteed that all order-updates will be passes through web socket ( in on_order_update ) given i dont block web socket on my end
    is it safe to use for it as trigger for placing close order for the position( need al updates without fail for the same) ? or should create code around kite.order_history or explore post backs ?
    ... is there any difference in certainty of updates in all three ?
    on which one should i rely upon ?

    thanx in advance for your time :)
  • rakeshr
    rakeshr edited January 2023
    is it guaranteed that all order-updates will be passes through web socket ( in on_order_update ) given i dont block web socket on my end
    Go through websocket FAQs here.
    is it safe to use for it as trigger for placing close order for the position( need al updates without fail for the same) ? or should create code around kite.order_history or explore post backs ?
    If it's for personal use, we recommend using WebSocket order update. Maybe you can have an extra layer of security to call orderbook, with the same order_id received in the webSocket update to confirm the status.
  • asto
    Thanx @rakeshr I ll look into it
This discussion has been closed.