which type of order to place

I had a python script, which place Buy order by reading Ask price and place Sell order by reading Bid price at defined logic. I am using -
trigger_price=ask_price / bid_price

but many times it fetches error: "kiteconnect.exceptions.InputException: Trigger price for stoploss sell orders should be lower than the last traded price (1731.05)."
Please help me know, which order type should I use to buy on Ask price and sell on Bid price?
  • prat
    prat edited June 2020
    The error means the trigger price has already crossed.you need to catch the Exception and retry with limit order "ORDER_TYPE_LIMIT"
  • rakeshr
    Maybe this article can help to understand SL trigger_price.
Sign In or Register to comment.