SL-M order bugged while using API

I am trying to place a “SL-M” buy Order using the API, which returns the status success:
Response Code: 200
Response Body: {‘status’: ‘success’, ‘data’: {‘order_id’: ‘***’}}

I passed the following through the API -
‘quantity’: 1,
‘product’: ‘I’,
‘validity’: ‘DAY’,
‘price’: 0,
‘tag’: ‘string’,
‘instrument_token’: ‘NSE_EQ|INE669E01016’,
‘order_type’: ‘SL-M’,
‘transaction_type’: ‘BUY’,
‘disclosed_quantity’: 0,
‘trigger_price’: 13.75,
‘is_amo’: False,

But when checked on the website, it said “Failed”, with the error “The trigger price set for your Stop Loss market order is invalid”.
I pressed “try placing again,” and it gave the error that “trigger price should be lower than price(0)”. I toggled to “Market” type order and then back to SL-M order and now it was allowing me to place it for the same trigger price on the website.

I think because I passed the “price:0” parameter, it flagged any trigger price as invalid but forgot that it was an SL-M type order and the “price” parameter does not matter.

Changing “price” to any high non-zero value does not help as it then gives the error that only only trigger price is required not the price value :slightly_smiling_face:

Please help

Thank you for reaching out. We will check and get back to you by tomorrow.

Hey @Pradeep_Jaiswar,
Did you find a solution for this ?

@Pradeep_Jaiswar did you any solution regarding the existing problem

You need to place a trigger price higher than LTP for the Buy SL-M order. In your case, to execute the trade at 13.75, you should place a limit order. Alternatively, you could use a GTT order to specify the conditions below, after, or immediately.

For instance, if a stock is priced at 50 and you wish to purchase it at 35, you would place a “limit order” with the price set to 35. If you prefer to buy at the current market price, you will use a “market order,” which does not require you to specify a price; your order will be executed at the best available rate. Alternatively, if you want to buy the stock only if it reaches 60, viewing this as a breakout, you can use an SL-M order with a trigger price of 60.

SL orders can be employed as follows:

Sell SL orders are placed below the buy price, while Buy SL orders are positioned above the sell price. This allows buying above the Last Traded Price (LTP) and selling below the LTP.

To purchase above the LTP, place a Buy SL order at the specified price you wish to buy.
To sell below the LTP, place a Sell SL order at the specified price you wish to sell.

I hope above infirmation is helpful.

1 Like