If you place a buy limit order with a price that is higher than the current Last Traded Price (LTP), the order will essentially act like a market order and execute immediately, as the market price is currently lower than your specified limit price; meaning you’ll buy at the prevailing market price, which is likely to be lower than your set limit price.
Thanks @Pradeep_Jaiswar.
Lets say if the market price is 500 and I want to put a purchase order of when the price goes to 501, then how can I do that? Do I need to use Trigger price here (but I remember you mentioned that trigger price is only for SL orders).
Could you please help me with this with a possible parameter values example.
Use case : I am building a logic based on certain levels of stock prices and would like to place pre-orders for my trigger prices.
Hi @RahulMittal87
As mentioned by @Pradeep_Jaiswar, if the limit price of a buy order is set higher than the current market price, the order will be executed immediately.
For instance, if the current price is 500 and you want to buy at 501, you would need to wait till the LTP reaches 501. To track this, you can either listen to the Market Feeder WebSocket for real-time updates or call the Market Quote API to fetch the latest price.
We recommend using the WebSocket, as it provides live updates of the LTP (Last Traded Price) for the instruments you subscribe to.
Thank you.
Thanks for the confirmation @Ketan & @Pradeep_Jaiswar
My question majorly arose because I am writing logic for Options, and I hit an error in few scripts that “MARKET” orders aren’t allowed on them. Till now, I was trading on EQ, and did not hit this problem with MARKET order type via code.
For options, since few scripts do not support MARKET order type, you mean, I should place the order as LIMIT and the order will anyhow get picked instantly without really waiting for the price I set in the order API. Correct?
Even for certain equity stocks market orders are not allowed. For instance, market orders are restricted for few recently listed companies.
That is correct only if you set the limit price greater than or equal to the stock’s LTP while buying. If the limit price is set below the market price, the order will remain pending until the LTP reaches the specified price.
Thank you.
Thank you @Ketan . yeah, I am keeping a slightly higher price than the LTP.
Yes, then it executes like a market order.
Hi @Ketan & @Pradeep_Jaiswar,
I am implementing a logic where in I want to profit trailing SL based on the LTP. I want to do following:
Let’s say:
Stock Purchase price = 590
Stock LTP = 600
And, I want to trail profit and set an order (at the time when the price is 600) that when the price goes to 597 , then the stock is sold at whatever price hits post 597.
This will be SL-M order right? and I can place it by the following request params:
{'quantity': 200,
'product': 'D',
'validity': 'DAY',
'price': 0,
'tag': 'UPSTOX',
'instrument_token': 'NSE_EQ|INE022Q01020',
'order_type': 'SL-M',
'transaction_type': 'SELL',
'disclosed_quantity': 0,
'trigger_price': 597,
'is_amo': 'false'}
In this case, though the price is 600 right now… If the price drops to 597, then the order gets placed and at the whatever is the next price, the order is executed.
Please confirm.
@RahulMittal87 Yes, with these parameters, your SL-M order will trigger at 597 and execute at the next available market price.
Below is the Execution Logic:
- While the price remains above 597, no action is taken.
- If the price drops to 597, the stop-loss order gets triggered.
- Since it’s an SL-M order, the stock will be sold at the next available market price after 597.
Possible Risks: If the price gaps down significantly (e.g., from 600 to 590 directly), your order will execute at 590 or lower instead of exactly 597. If you want more control, you may consider an SL-Limit Order instead of SL-M.
Hope it helps.
Thanks a lot @Anand_Sajankar. This was really a great explanation to my query