Automated Pre-open order?

Does Dhan App or dhan API offer an option to send a limit order to exchange at a particular time?

Example, I want to send a buy order to the exchange exactly at 9:00:00:01 for execution in the pre-open session? Can this be automated?
Do I have an option to chose the exchange like BSE or NSE for order placement?

This is for stocks, and not F&O

If you could show the app option or code snippet, it will be very helpful

Thank you!


Hi @cheral Firstly, not just any broking platform but even the exchanges will not guarantee anyone execution at 9:00:00:01 or any specific time.

With that disclosure, on Dhan when you place an AMO order for Stocks - you have an option to place order in Pre-Market. Orders will be sent to exchanges for execution when market opens for pre-open, execution will depend on the exchanges. If there is no liquidity for trades in pre-market, then the securities will be traded when market opens for regular trading session.


Thanks @PravinJ for the clarification. Does dhan API allows one to write code that could trigger an order placement at a particular time?
The time could be 9 am or even 10:00 am or 3:15.

If yes, it would be helpful if you could share API documentation for the same. Thanks

Btw, orders don’t get executed on NSE at 9:00 AM. There is specific way in which market functions from 9 AM to 9:15 AM.

you can use the below code to place order a 10 AM. Install pip install schedule before using the below code

import schedule
import time

def do_something():

    # write your logic to place order
    t = time.localtime()
    current_time = time.strftime("%H:%M:%S", t)
    print("Your order placed at = ", current_time)
    # Exit the loop after successful placing order
    global running
    running = False

# Schedule the job at 10 AM

running = True
while running:

@PravinJ I understand that order’s do not get executed at 9 am ; they are collected in pre-open session and used to identify the open price.

I understand that my order will be “placed // sent to exchange” and not executed.
But I would like to understand the time lage it takes for Dhan’s systems to send an order to exchange; once I send an API request to your systems.

Do you have any data on that? or any way for me to monitor the time for various steps. TIA !!

Thank you @shailesh ; helpful for me to get started.