Bracket Order at Market Price

Hello Team,

I am currently exploring Dhan as a potential tech platform and considering migrating from my current brokers.

However, before making any decisions, I have a few queries that I would appreciate clarification on. While I understand that much of this information is available in the documentation, I believe it’s prudent to confirm these details before committing any investments and potentially incurring losses.

  1. Could you please confirm if it’s possible to place a bracket order at market price in option trading?

  2. Additionally, could someone provide a response body containing all the required parameters? I noticed that while the price field is mandatory, I’m curious as to why it’s necessary to include this attribute when the order type is Market.

I understand the importance of these details in making informed decisions, and any clarification provided would be greatly appreciated.
Thank you for your assistance.

  1. For Option trading , I dont think that you can place any BO. It is for Equity and Futures
  2. For Order placement using Dhan API you can use place order and you can try with minimum parameters as follows
dhan.place_order(
    tag='',
    transaction_type=dhan.BUY,
    exchange_segment=dhan.NSE,
    product_type=dhan.INTRA,
    order_type=dhan.MARKET,
    validity='DAY',
    security_id='1333', #Secrity_ID, Refer to Security Sheet
    quantity=10,
   
)
1 Like

Hello @aditya3

Welcome to Dhan Community!

Just a note on Sammy’s answer,

You can place BO order for Options as well, and at market price/limit price

2 Likes

Hey @Hardik @Sammy

I appreciate your assistance in addressing my previous queries. Before finalizing my approach, I seek confirmation on a few specific aspects related to option trading parameters related to “BO at Market Price”

BO Response Body At Market Price (API)

{
    "dhanClientId":"xxxxxxxx",
    "correlationId":"xxxxxxx",
    "transactionType":"BUY",
    "exchangeSegment":"NSE_FNO",
    "productType":"INTRADAY",
    "orderType":"MARKET",
    "validity":"DAY",
    "securityId":"11536",
    "price": 0, --> For Market Order Type price should be kept 0
    "quantity":"30", --> Means I will be buying 2 lots
    "boProfitValue":"30", --> Order placed at 200 - profit will be booked at 230
    "boStopLossValue": "100" --> Order placed at 200 - loss will be booked at 100
}

Please verify this API response body is right or wrong for placing “BO at Market Price” , I have created this response based on my understanding and taking reference from @Sammy reply and other threads.

I aim to ensure precise execution in my trading strategies, hence your insights on these points would be immensely valuable.

Thank you for your time and assistance.

1 Like

Hi @aditya3 ,
Your code seems to be ok but here are few things to be kept in check
Quantity → When you say quantity 30 , and then i assume that you are talking a scrip where 1 lot size 15 Qty i.e. 2x15 = 30 Qty for 2 lots.

Rest of it seems to be OK.
However, Please make sure while using BO , you can use it in Only Futures and Equity. For options trade it is not available. Also make sure that, you have enough liquidity while working with BO to avoid any unnecessary liquidity issue.

For more details , Please refer to do’s and Don’t Here:

2 Likes

Hi,

Quick question as I am also on the similar journey of exploring the API to place bracket orders for options. How do you figure out the security Id? for example: Nifty Next week expiry strike 22500 call

That’s is From Security ID sheet from dhan API documentation

1 Like

thank you for info on security ID

hi @aditya3

hope you are doing good. I found this thread to be similar to what I am trying to work out.

I wanted to check with you if you are able to get the dhan api to place BO orders on options?

Hi @mnikhil , I haven’t started yet but by this month’s end will start using it.

Will post if I found any further issues regarding placing of BO order in this thread.

thank you @aditya3 , appreciate it. I would be keen to exchange my technical notes too.

1 Like

@Hardik

a quick question, although slightly varying at this point, I was wondering if I were to place a basket of orders together for Options, is that possible, given the context to the margin constraints? Like spreads, strangles or straddles or baskets with multiple legs?

How would that look like, for an example?

Hello @mnikhil

We do not have basket orders directly available on APIs, however, if you do place orders as per strategy, then you will get the hedge benefit (similar to baskets on Dhan).

hi @Hardik

Ok, lets say for Short Iron Condor strategy, what is the sequence of the orders that one needs to place for availing hedge/margin benefits?

Hello @mnikhil

For any strategy, always ensure buy orders are placed before and then sell orders. This is for the reason that sell margin is higher and can be hedged against long position.

Ok, that seems tricky given how it could work.

OTOH, any plans to make basket order api available soon?

@mnikhil

Not right now but will check if this is something which should be offered via APIs, as basket orders are essentially just collection of orders on API layer.

yes, vetting internally makes sense but I see it does help with simplification