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.
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.
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.
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
tag
insidekite.place_order
.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????