Code for buy stop limit order for index options

I am using the following code for stop limit buying for BankNifty option. Orders are not going through, while same code works for equity.

dhan.place_order(
tag=‘’,
transaction_type=dhan.BUY,
exchange_segment=dhan.NSE,
product_type=dhan.INTRA,
order_type=dhan.SL,
validity=‘DAY’,
security_id=‘67546’,
quantity=15,
disclosed_quantity=0,
price=12,
trigger_price=11.9,
after_market_order=False,
amo_time=‘OPEN’,
bo_profit_value=0,
bo_stop_loss_Value=0,
drv_expiry_date=None,
drv_options_type=None,
drv_strike_price=None
)

Hello @Dev

Can you confirm what error message are you getting?

Do note that exchange segment needs to be dhan.NSE_FNO for trading in NSE futures and options.

Thanks Hardik,

I eliminated some of the extra parameters and changed the exchange to FNO. It worked.
I am new and do make some elementary mistakes.

Requesting you for additional help:
I am trying to use the orderStatus== ‘TRADED’ to trigger a Stoploss limit sell order as soon as the buy order is executed, but could not find a sample code that uses orderStatus. Here is my code. Can you help.
This is a scalping code I am trying to build. So further, I will need the LTP to use it to trail this stop loss. Can you provide the code to retrieve the LTP. I have seen some of the websocket code but I am still confused, how do i get the LTP from there. Thanks a ton in advance.
Here is my code till now:

from dhanhq import dhanhq
import pandas as pd

client_id = “”
access_token = “”
dhan = dhanhq(client_id,access_token)

price1 = 14
trigger_price1 = price1 - 0.1

#Place a buy order in NFO
def place_Buy():
option_id = dhan.place_order(
transaction_type=dhan.BUY,
exchange_segment=dhan.NSE_FNO,
product_type=dhan.INTRA,
order_type=dhan.SL,
security_id=67521,
quantity=15,
disclosed_quantity=0,
price=price1,
trigger_price=trigger_price1,
after_market_order=False,
bo_profit_value=0,
bo_stop_loss_Value=0,
drv_expiry_date=None,
drv_options_type=None,
drv_strike_price=None
)
return option_id

op_id = place_Buy()
print(op_id)

if (op_id.orderStatus == ‘TRADED’):
print(" Trade successful")