Placing orders on Dhan from a pinescript strategy in trading view

How can we place orders on Dhan through pinescript strategy.

Hi Hardik,

I am getting alerts on trading view but the orders are not getting placed in Dhan

Its been more than 1 week but my issue is not getting resolved. I have cried for help many times still its not getting resolved.

I request you to please take a look into my account and see whats wrong . Otherwise please tell me if its possible for Dhan to resolve this error or not

Hello @pyrasp

Over here, from the screenshot, the orders were triggered at 10PM, when markets are closed. Can you please check during market hours?

Hi Hardik

Its not 10 pm . Its showing my current desktop timing which is US timing ( by mistake configured on my desktop) . The trades have been placed today at 11 am.


In that case, kindly share your Client ID over DM, and I’ll get this checked for your account.

Hi Hardik,

I have emailed you the client id ( Is there any other way of DM? Didnt know of any other way so emailed you. )

One more thing I wanted to confirm, is there any minimum balance which should be maintained in the account only after which the pinescript will execute the orders for them?

No. But for your order to get executed u need to have the appropriate amount in the account. If not order will be placed but it will fail to execute.

Yeah thats there… I am executing just 100 Rs trade as of now . Account balance is 200


Can you please share ur Banknifty alert log ? Will see whether there is any obvious error in the alert string that is causing u r alert order to fail.

Here are my alerts details


Seems correct to me. U r webhook url is still valid and order JSON generated for that string itself ?

Yes, its valid for 30 days. the JSON code and webhook both

Ok then up to Dhan guys. Not sure why it is not firing.

@Hardik Hey if you are not able to understand the problem , we can try over teamviewer. It will be good to check the problem live

@t7support if you don’t mind, could you give me a working pinescript which works at your end just to cross check if it fires at my end ?

I don’t trade in futures. You are trading in futures. So my script won’t help you. Can you try to place an option order from your script just to check whether it’s an instrument related error ?

I have already put the options alert… it’s firing in trading view but no order in dhan…