Introducing Webhook Alerts : Direct Order Placements on TradingView from Dhan

This will be available by mid-late January 23, we are hoping to ship it by that time.

Welcome to Dhan community @Rajendra :slight_smile:

1 Like

I have 2 trading account with Dhan. 1 for me and 1 for my wife. And I have 1 TV pro account.
I have coded 2 strategies with pine script and automate them with webhook in those 2 accounts to clearly see difference of outcome.
Both strategies have minor difference only and hence most of the times signals are generated at same time.
But only 1 account receives signal and other account doesn’t.
Why is so ?

Can’t I place webhook orders for 2 strategies in 2 Dhan accounts ?

I use basket orders for my strategies and generate buy and sell signals from (alert condition) and integrate them with buy and sell basket.
My query is should I use same webhook url for buy and sell alerts and just a different JSON script ?
Or I need 2 webhook urls - 1 for buy basket and 1 for sell basket ?

Thank you Dhan for excellent support team !!

I have deleted old alerts.

Now I have put same webhook url in both buy and sell alerts (having same ‘Secret’)

Strategy 1 - Account 1 - 1 webhook url (Generated for account 1) in both buy and sell alerts
Strategy 2 - Account 2 - 1 webhook url (Generated from account 2) in both buy and sell alerts

Hope what I have done is right this time.

Waiting for a confirmatory reply from the team !

@Naman @Hardik @PravinJ pls reply

Hi Chackiath,

I’m new to Dhan and trying out webhook based order placement and its not working, same as issue that you described above. Let me know how you could able to resolve the issue.

Thanks in advance,

Hello Ragha,

I have replied to your query here: Order placement thru trading view webhook is not working - #2 by Hardik

Hope this helps! Let us know at if the issue still persists.

Hello @Tapan_Shah

Apologies for the delayed response here. After going through your use case, I would ask you to generate separate Webhook URLs for each account once only with desired validity.

Also, while adding the JSON in your pinescript, please make sure you take the secret code from each account separately as the secret code is unique and linked to the webhook URL. In no way is it possible to use same secret in two accounts with two different webhooks.

Also, you can always reach out to @Dhan_Help at for any such queries. Our team is always here to help you out!

1 Like

I did the same this time

For account 1 - 1 webhook url for buy (with buy basket Json script) and same webhook url for sell (but with sell basket Json script)

For account 2 - Newly generated webhook url for buy (with new buy basket Json script) and same new webhook url for sell (but with new sell basket Json script)

Hope this is right


Yes. This is correct. Let me know if you face any errors.

1 Like

Not sure if this is doable. if we could combine basket ID and regular JSON into one alert format and Dhan could read would really help.

Noted, will try to build this.

Working perfectly.
Thanks for the support!

1 Like

Hi Amit,

Even i’m stuck with this limitation using basket orders.
My pine script based strategy generates Buy/Sell signals but not sure how to trigger separate basket orders created for Buy or Sell.

  • Ragha

Dhan is not providing complete video using an example… i don’t know why? multiple times i asked this…

pravin ji, Naman ji
can you support here on his to execute option call buy and put buy using tradingview pinescript strategy…and how to automate it.

has anyone in this community has solution, please let us know.

I have a range breakout strategy for Nifty Futures in tradingview.

It generates a long buy alert when a candle closes above the upper range and short sell when a candle closes below the lower range.

There is a fixed stop loss. It generates exit long or exit short alerts as soon as the stop loss triggers. If stop loss won’t trigger then it will close the trade at 3:15 pm.

Can anyone outline how I can automate this with the web hooks?

Hi @killedar.amit

To execute long call & long put for bullish & bearish signal respectively for your strategy you have to create two different basket Create two different alerts and execute them with respective signals. Make sure you have same and active webhook URL for both the alerts.

PS : We are revamping this feature and working to execute options directly using webhook, without creating basket. We will keep you posted here.


I have tried as per your suggestion, but both basket orders execute simultaneously.

Request to share nomenclature for Future and options so that we can rename them in pine script and get the proper alerts executed.

@Hardik and @Naman …Thank you for your all fine tools…Request to advise on

  1. How to test and verify webhook… I am unable to see any logs or invalid syntax or any kind of error…If my webhook doesnot work from TV.
  2. On Orderpage, if we can distinguish between manual punch order and webhook or TV chart input order will be great help to identify & analyse scripts and logic.


To answer your questions here:

  1. Currently we are not planning to build any log system as we have kept the interface and JSON generation simple enough for users to place order even with zero technical knowledge. Your webhook will always work as long as the steps are being followed.
  2. We will evaluate adding custom tags for better differentiation.