Introducing Webhook Alerts : Direct Order Placements on TradingView from Dhan

@Hardik thanks for the quick reply
They are required if we want to put SL along with entry.

I have defined a condition on Trading view and when that condition is met, the alert gets triggered and you enter automatically via webhook.
But at the same time, you want to place SL as well so that you dont have to look at screen and put it manually.

I will give you more details to clarify. I have the following code in pine script

if  condition_is_met
	alert('{"transactionType":"B","orderType":"MKT","quantity":"10","price":"0","exchange":"NSE","secret":"AFVwh","tradingSymbol":"' + syminfo.ticker +'","productType":"I"}', freq=alert.freq_once_per_bar_close)
    alert('{"transactionType":"S","orderType":"LMT","quantity":"5","price":"user_defined","exchange":"NSE","secret":"yUMuD","tradingSymbol":"' + syminfo.ticker +'","productType":"I"}', freq=alert.freq_once_per_bar_close)

As you can see in this case, I am able to enter and put a limit order to book half the quantity at the same time at take profit level. But I cant put a SLM order.

I want to add something like this :

	alert('{"transactionType":"S","orderType":"SLM","quantity":"10","price":"SL_LEVEL","exchange":"NSE","secret":"AFVwh","tradingSymbol":"' + syminfo.ticker +'","productType":"I"}', freq=alert.freq_once_per_bar_close)
    

I want an SLM order to be kept as my SL which DHAN webhook does not allow. That would make so much easier. You can put SL and take profit at the same time.

Hope this makes it clear. Thank you

Hello @Jitesh

Understood this scenario. But webhooks which allow Buy and Sell already can be used to place Stop Loss and Target as well. You can simply code this is Pine script.

When the alert is triggered, you can place subsequent orders by placing limit order at defined price. Further, we will also evaluate adding Stop Loss as order type on webhook.

Hi @Hardik
Yes, you can put Target. But I m not able to understand how to put SL ?

Lets say you buy a stock at 100. You can put a limit SELL at 105 (Take profit). But what you cannot do is place a limit SELL order at 95 (SL).

You can put a limit order to sell it when the profit target is reached. I incorporated it in the first 2 lines of code. But how do you sell at a lower price (even limit order works for higher price) ? you need SL order to do that.
Please help

1 Like

Hi @Hardik any updates ?

and is there a way to put SL order by webhooks that might have missed my mind?

Hey @Jitesh

Missed this thread earlier. Yes, you are correct on this and will evaluate adding SL order in future.

Thanks for the reply @Hardik . I dont think it is much ask from our side. I have been trying to find a workaround but to no avail. If I happen to work something out, will update here so that any other trader might benefit.
In the meantime, would request Dhan team to incorporate it, would help a lot. Mny thanks

2 Likes

Hi Hardik,
Is there any update on Enhance Webhook, for Option through TreadingView website, waiting for it.

regards,

Hello @sameercn

Great to see you active on community after a while. Yes, enhanced webhooks are almost ready to ship and we plan to launch it by next month. Will announce it first on community itself, as soon as we ship.

1 Like

Hello i am using webhook from last 2 months i never faced any problem but today i faced unique my buy side webhook orders are not placing on dhan while sell side webhook orders are getting placed ā€¦i tried index tradingā€¦crude silver in all sell side alert signal orders are getting placed while buy side orders are not getting placedā€¦whats the reason kindly reply soon

Hi ,

  1. Is it possible to use dynamic option data for trading symbol field ? For example instead of typing an option name , we enter something like , banknifty , expiry date, ce/pe , +/- strike price from spot price , with target and stoploss % so that it may triggers basket order.

Hello @deepakchandar

Yes, we have built something on similar lines as webhook enhancement and we plan to release this really soon. We are almost ready and doing final QA before we release.

So keep a close eye on community for this updates.

1 Like

Thatā€™s cool , waiting for that so we can use it like algo platform aswell

For Webhook, Let says i have a code that decides strike price. I need to place an order through webhook as a market order and additional parameters such as Take profit and Stop loss in points?

How to place bracket order for options with market type and sending an alert with target price and a stoploss in points. Donā€™t see any documentation that describes this. One of the reason I joined dhan is webhook feature but i donā€™t see that the same is currently supported. Would be great to see an example/ documentation on how other option users are taking benefit of Webhook integration with dhan.

I am not able to see the link for webhook as shown in the above image. In that place link for dhanHQ is shown. is this feature discontinued or link moved ?

Yes, facing the same issue since morning. Raised a ticket. @Hardik might help expedite the process

Thank you! But my requirement is to place order type as bracket order with Profit and Stoploss in points. I guess, currently Bracket order is not supported.

Now, you can place orders not just on scrips available on TradingView.com but also on any chart in Equity, Futures, Options, & even Multi-segments! Read more on this here - Introducing: Webhooks as Order Type on Dhan. Now do Options Trading on TradingView.com

@yashbindlish Now, with Webhooks on Dhan, you are not limited to scrips available on TradingView.com . You can place orders based on any chart in Equity, Futures, Options and even Multi-segments. Not just this, you can continue trading via Dhan Baskets on TradingView.com . Here is a detailed post on it with a demo video - Introducing: Webhooks as Order Type on Dhan. Now do Options Trading on TradingView.com

Still do not see bracket order with fixed Profit and Loss trigger in points that is possible through bracket order.