Sample python code to place_gtt order

srikanthg
I want to make use of kite.place_gtt function to create stoploss. I could not understand the documentation. Please give me a sample program. Thanks in advance.
  • NarayanRao
    this is from Nov and still no reply.. Couldnt find this even in other forums
  • rakeshr
    ORDER= [
    {
    "exchange":"NFO",
    "tradingsymbol": "NIFTY20OCTFUT",
    "transaction_type": kite.TRANSACTION_TYPE_SELL,
    "quantity": 1,
    "order_type": "LIMIT",
    "product": "NRML",
    "price": 11450
    },
    {
    "exchange":"NFO",
    "tradingsymbol": "NIFTY20OCTFUT",
    "transaction_type": kite.TRANSACTION_TYPE_SELL,
    "quantity": 1,
    "order_type": "LIMIT",
    "product": "NRML",
    "price": 12000
    }]
    trigger_id = kite.place_gtt(trigger_type=kite.GTT_TYPE_OCO, tradingsymbol='NIFTY20OCTFUT', exchange='NFO', trigger_values=[11450,12000], last_price=11894,orders=ORDER)
    You can refer above sample example.
  • ronstrader
    Shouldn't the first order type be 'STOPLOSS' (SL)?
  • SRIJAN
    @ronstrader the first order is sl. This gtt is for selling. Means after you buy it,to squareoff. So ,the first order is sl. And second one is target. When one of the two is triggered,the other one is cancelled.
Sign In or Register to comment.