I am trying to build a logic as explained below but could not find a direct approach in upstox api.
if condition == True:
1. SEND market order. ( I can do this using market order api)
2. SEND SL-LIMIT order ( can di this using api as well.)
3. SEND another limit order (for example 10% of buying price). How can I do that, Should I use LIMIT order for that. Is that allowed? I mean having two open orders for a the same intruments.
I am applying these logics to options buy ( call or put buy). If i send two sell order , would that casue margin issue?
Yes, you can place a sell limit order at a price higher than the LTP, and you can also have multiple open orders for the same instrument.
Yes, this will result in a margin issue since you will have two sell orders. The second sell order will require additional margin, as it is treated as a short sell without an existing buy position.
To address this, you can place a GTT order through the website or mobile app. Currently, GTT orders are not available via the API, but they are on our roadmap, and we will notify you once they are implemented.
If you prefer to use the API, there is an alternative approach. You can subscribe to the Market Feeder WebSocket for live market data or periodically call the Market Quotes API to retrieve the last traded price (LTP). Once the LTP reaches your desired sell price, you can place an order accordingly.
Thanks for sharing your suggestion on this. Do you have any rough estimate by when we can have OCO type of orders available in api? Q1, Q2, Q3, Q4 any rough idea will help.