Order placement failure

Varun_22
I am running algo to download prices of option chain at 9:30. Then I check for price of selected options to cross trigger point. On cross of trigger, I place market buy & SL order. The prices of selected options are refreshed every 30 seconds. While the prices are loading/ refreshing without any issue. When trigger gets met lets say after 2 hours, the order placement does not work

Syntax for order placement is correct as I tested same by putting in a fresh code & executed. Would request help to understand that am I missing something
  • Varun_22
    I am facing this issue in Zerodha Kite API
  • rakeshr
    the order placement does not work
    Is it throwing any error/exception? Can you paste here the complete error message?
  • Varun_22
    This is message log I am getting in & around order placement failure

    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /quote/ltp?i=NFO%3ANIFTY22N1718400CE HTTP/1.1" 200 None
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /orders/regular HTTP/1.1" 400 154
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /orders/regular HTTP/1.1" 400 154
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.telegram.org:443
  • sujith
    You seem to be getting an input exception. You can enabled debug logs and check the exception message.
  • Varun_22
    Apologies I am a novice coder, please help me as to what is input exception. May be I can resolve this at my end with that information
    Also how do I enable debug logs
  • sujith
    @Varun_22,
    You can checkout pykiteconnect here.
  • Varun_22
    Thanks will try to run it tomorrow on debug mode when market opens

    Have put below command I am using for market order, which seems to be generating input exception. Request if you can look & suggest if there are any obvious errors

    pe_order_id = kite.place_order(tradingsymbol= PE_ticker, exchange= kite.EXCHANGE_NFO, transaction_type= kite.TRANSACTION_TYPE_BUY, quantity= 50, variety= kite.VARIETY_REGULAR, product= kite.PRODUCT_NRML, order_type= kite.ORDER_TYPE_MARKET)
  • sujith
    Market orders are not allowed for F&O, you will have to place limit order at LTP.
  • Varun_22
    Thanks for pointing this out. Is my SL order not going through since market order wasnt being placed. Have put documentation for SL order below

    pe_limitorder_id = kite.place_order(tradingsymbol= PE_ticker, exchange= kite.EXCHANGE_NFO, transaction_type= kite.TRANSACTION_TYPE_SELL, quantity= 50, variety= kite.VARIETY_REGULAR, product= kite.PRODUCT_NRML, order_type= kite.ORDER_TYPE_SL, price= PE_Stoploss, trigger_price= PE_Stoploss+.2)
  • sujith
    For SL, once trigger is hit, it becomes a limit order. It should be fine. It will be a problem for SL-M order.
  • sujith
    And also make sure that all the price and trigger price are modulus of tick size.
  • Varun_22
    Thanks for the clarification. Wanted to check on the point that is stop loss error not getting placed since there is no outstanding quantity or the documentation shared above has some input error
  • Varun_22
    Below is the error message I am getting. But issue I have is the same ticker is being used for price quote, it's working fine
  • rakeshr
    The instrument you are placing an order for has either expired or doesn't exit
    Check for extra spaces in the trading symbol and exchange name.
  • Varun_22
    I think I am giving correct ticker, pl take a look at top of screen where I have printed the ticker which I am passing & same error is being generated as pointed above
  • rakeshr
    NFO:NIFTY22NOV18300CE
    You are sending the wrong trading symbol, it should only be NIFTY22NOV18300CE. You can fetch trading symbol detail from the instrument list.
  • Varun_22
    Thanks, it is working now
This discussion has been closed.