Automatically placing Duplicate orders

Saurabh007
I placed SBI SLM buy order of quantity 15 and reliance SLM buy order of quantity 6 but system automatically placed duplicate order and I brought double quantities.
How can I fix this issue.
  • sujith
    I would suggest checking the orderbook before retry placing the order. You may use tags and maintain a unique tag for every order.
  • Saurabh007
    How to use unique tag for every order?
  • RED
    Use a timestamp as tag, it helps you maintain unique ids for orders.

    Frequently check orderbook for open orders along the tag and proceed further. If a tag status is successful stop placing fresh order for that counter and if a tag is still active stop duplicating. Similarly if a tag has failed try to read the status message and proceed accordingly.
  • Saurabh007
    try:
    kite.place_order(
    variety=kite.VARIETY_REGULAR,
    exchange=kite.EXCHANGE_NSE,
    tradingsymbol="SBIN",
    transaction_type=kite.TRANSACTION_TYPE_BUY,
    quantity=qutS,
    product=kite.PRODUCT_MIS,
    order_type=kite.ORDER_TYPE_SLM,
    trigger_price=highS+0.05
    )

    again placing duplicate order automatically
  • rakeshr
    How to use unique tag for every order?
    To add a tag field, while placing an order you need to send an extra param of tag inside kite.place_order.
    kite.place_order(
    variety=kite.VARIETY_REGULAR,
    exchange=kite.EXCHANGE_NSE,
    ........,
    tag='your_unique_tag'
    )
  • Saurabh007
    Stag='SBI001'
    if Stag not in kite.orders():
    kite.place_order(
    variety=kite.VARIETY_REGULAR,
    exchange=kite.EXCHANGE_NSE,
    tradingsymbol="SBIN",
    transaction_type=kite.TRANSACTION_TYPE_BUY,
    quantity=1,
    product=kite.PRODUCT_MIS,
    order_type=kite.ORDER_TYPE_SLM,
    trigger_price=380,
    tag=Stag
    )
    print("done")
    else:
    print("Not done")

    is it correct????
Sign In or Register to comment.