Introducing: Now execute your Basket Orders via webhooks on TradingView

Can anyone guide here on how to use webhooks for options call and put buy.

Hi @killedar.amit,

We have shared the details regarding the order placement in the above article.

If it doesn’t meet your requirements, kindly drop us an email at help@dhan.co we will be happy to assist you.

Regards,
Poornima

Hi @killedar.amit Amit

To trade options via webhook you have to use basket orders. Create two different basket, one with Call Buy & another with Put Buy. For long signals trigger call buy basket & for short signal trigger put buy basket.

Hope this helps

Naman Ji , Pravin Ji
Can you elaborate more with an complete end to end example for option call buy and option put buy using webhooks basket order.
I am struggling for this from quite some time now…

Hi @killedar.amit

No worries, here is the video on executing basket order via webhook - Execute your Basket Orders via Webhook on Tradingview.com from Dhan - YouTube

You have to create two different basket, one with call and another with put. Trigger respective basket as per your strategy.

Hello @Naman Sir
I have a query.
Can I place webhook order via 1 tradingview account to multiple Dhan accounts simultaneously?
Like I have 1 tradingview pro account and I want to place order via Webhook to my 3 to 5 Dhan accounts simultaneously. Is it possible?
Thank you in advance.

Hello @Tapan_Shah

Welcome to Dhan Community! Dhan Webhook URL is unique to every account and on TradingView, you can only add 1 webhook URL per alert.

Hence, it will not be possible to place orders in multiple accounts using TradingView webhook.

1 Like

both call and put buy execute at the same time for two different basket orders…with webhooks using tradingview strategy

hi can you please provide clarity on below for option trading

  1. My webhook basket alert is set on, later on if I change or edit the basket in terms of quantity , do I need to re write another alert(copy past json & webhook url) or the changes in basket will get updated automatically ?
  2. I normally assign alerts to horizontal ray marked on the chart, So can I reuse already executed alert with same webhooks and json to enter the new position again by placing at new level ? i thought i can align one basket order to that alert on a horizontal ray and later on just shift the ray above/below to buy option for that day

Hello @nickpats

Hope this answers your queries:

  1. Yes. If your basket is set already and you want to modify basket, you can do so and the same changes will get reflected as long as the basket has not been executed.
  2. Yes. You can do this too. Just ensure that the alert is active after you have realigned the same at different price level.

ok hardik, however when i edited my basked in terms of change in qty it dint got executed, and even the i couldn’t repeat the buy order alert by realigning horizontal ray
, Could it be because i had 3 different webhooks alerts active for same index

Hey @nickpats

So two things here:

  • Do ensure that you have not created a new Webhook URL for each alert. If you are doing this, then the system deletes your existing Webhook URL [since we only maintain 1 webhook per user] and hence, the order will not get placed.
  • For the realigning of triggers, I am not sure on how you are setting up the alerts again. This shouldn’t be a problem, but will require more details here to help you better.

Refer to the first point and ensure only one single webhook URL and secret code is used. Placing multiple alerts on one chart will not be the reason here.

1 Like


hi Hardik
check the above images, as per your instruction, I have kept same url and different json for different basket. however if you can see on url expire time it says 1;40 pm ,

  1. so what will happen after 1;40 pm, all my existing web hooks will become invalid ?
  2. If I click on url valid for 7 days , does that mean I can have an active alert basket valid for 7 days without doing any changes everyday ?
  3. If yes, do I have to make sure that I use same url for any other basket during those 7 days ?

I had never used basket web hooks till now but thought to try it out and the execution speed was superb also it helped me a lot to trade options immediately based on index level. thank you for this feature

@nickpats
Answering your questions here:

Yes. If the URL expires, then the webhook will not place order.

Yes. It will remain valid. However, once executed, TradingView won’t trigger the same alert again

This is mandatory. If you change the URL, then all the previous alerts mapped will be disabled.

Hope this helps.

1 Like

Sir how to set SL through webhook on basket ? Position taken through TV alert sometime goes wrong and we need to hit SL for it. How can we do it provided entry order basket already executed for an option?

Hello @cookoo,

For SL, you can place an alert at SL price level in addition to your exit alert on Trading View to trigger your sell basket. In this way, you can use one single basket for exiting a trade at both target and stop loss, whichever hits first.

Hi Hardik, this seems interesting, can you please elaborate it in simpler way . thank you

Hi Hardik / Pravin ji

No new product feature announcement since last many days. I m eagerly waiting for webhooks for options, feature launch. What is the plan for launch.

Hardik
You should explain step by step for buy order, sell order, stop loss order …It is very confusing for traders due to incomplete information.

Hello @nickpats

Sure. Let’s say you create a basket of orders with stocks/instruments for positions that you wish to exit via Webhook.

Now, you can go ahead and create JSON for the basket via Dhan Web.

You can then place two price alerts on TradingView Charts:

  1. For Target, at a price higher than current price
  2. For Stop Loss, at a price lower than current price or vice versa.

On both these alerts, you add the same Basket JSON that you generated for exiting the position.
Now, whichever alert gets triggered first, your orders will be executed.

Note: This is on the assumption that you are adding market orders in the basket.