Introducing Webhook Alerts : Direct Order Placements on TradingView from Dhan

@Hardik, Still i am confused what features are avaiable for Dhan user on trading view on metioned ,“https://tv.dhan.co/login/”.
I am not able to use multiple charts option also , same stocks are showing in all 4 charts or 8 charts layout.

Multiple times, I have communicated to dhan team regarding webbook through option trading but every time they refer to the same 2 to 3 minutes video where nothing is clear.
they should in detail or explain with an comple example.
I am not sure, if they have any answers on this.

Sir one question:
Is there a way I can programatically or some other way in Dhan to determine what’s the ATM strike? Because based on Spot BankNifty or Nifty I want to place on ATM call/put.
Basically how can I get it progrmatically? “BANKNIFTY2212037800CE”

Hello @crs

Welcome to Dhan Community!

Yes. In case of basket orders, since there is no parameter such as buy/sell a basket, you will have to customise the order inside the basket to be able to exit the position.

However, we are planning to come up with a Webhook enhancement soon, which will solve this problem for all options traders.

Hello @ajaypande

tv.dhan.co is TradingView hosted library on Dhan. It is a great platform to leverage a lot of Trading View premium features at no extra cost. It also enables options trading with Trading View native experience. However, Trading View Webhooks is an altogether different product offering, for traders who want to use tradingview.com or pinescript to place their trades.

If you are facing any issues with Dhan Trading View platform (tv.dhan.co), you can always reach out to @Dhan_Help at help@dhan.co.

Hello @killedar.amit

Currently, options trading is only available on Webhook via Basket orders. You can add as many legs as you want and simply trigger a basket from Trading View.

Hi Hardik,
Thanks for the quick response. is there a plan to integrate customised pine script in tv.dhan.co. If we can execute our own pine script on tv.dhan.co we don’t need to use any webhook for our strategy.

Its very unlikely that the pine script editor will be extended by TradingView to hosted version that is on tv.dhan.co

2 Likes

Hello,

I wanted clarification on one thing.

Suppose
My Tradingview alert triggers a buy signal of say 20 Reliance shares for delivery on the hourly chart.
{“transactionType”:“B”,“orderType”:“MKT”,“quantity”:“20”,“price”:“0”,“exchange”:"{{exchange}}",“secret”:“XXXX”,“tradingSymbol”:"{{ticker}}",“productType”:“C”}

I take delivery of the shares upon settlement.

If i make a webhook for the sell signal,
{“transactionType”:“S”,“orderType”:“MKT”,“quantity”:“20”,“price”:“0”,“exchange”:"{{exchange}}",“secret”:“XXXXX”,“tradingSymbol”:"{{ticker}}",“productType”:“C”}

Will it sell from the shares i have in the portfolio which i have taken delivery of?

Kindly do reply.

Hi @PravinJ , @Naman

I am very new to Dhan :star_struck:,. I am so excited to be part of Dhan :smiling_face_with_three_hearts: :heart_eyes:.,. I came to dhan because of ONE AND ONLY MAIN BEST FEATURE WHICH NEVER HAD EARLIER IN INDIA THAT DHAN IS COMPLETELY INTEGRATED WITH TRADINGVIEW,. :sparkling_heart: So, I can back test my strategies in PineScript & integrate the same with Dhan.

I have created the alerts using the “Alert” popup in TradingView & it’s sending the alerts seamlessly to my Dhan Account (And i can see the performance of trade response in just 2 secs at maximum).,. I am very excited to see those automated Trading in My Strategies. Going forward like me, so many Algo traders would get benefitted by Dhan.,.

But still I am expecting Few more improvements from Dhan for TradingView Webhook JSON ::

  1. PLEASE IMPLEMENT THE PINESCRIPT STRATEGY ALERT WITH DHAN. Only Create Alert is working, pinescript alert not working, But Traders like me, will be creating the alert message(using Alert Function) in Pinescript.,. Inside pinescript Alert message will be passed through via Main Alert.,. Trading View is showing that Alert, But Dhan is not consuming that Alert message (which created in PineScript).
    Please view the below example, I am passing the Dhan JSON format in Pine script Alert (Not through the “Create Alert” popup).,. TradingView recognize and shows this alert., But Dhan is not consuming this Alert.

(Note:: The main reason, i am passing the Alert via pine script because, every strategies will have Entry & exit of both buy/Sell sides. If i created the Buy Alert & Sell Alert using Create Alert popup in TradingView, both are triggering simultaneously to Dhan., But I need only one right alert to be triggered for my strategy which i can decide dynamically in the script. these feature currently not available, please implement soon., So it would be more beneficial to the Algo Traders.

  1. PLEASE IMPLEMENT COVER & BRACKET ORDERS JSONS AS SOON AS POSSIBLE FOR INDEX & STOCK FUTURES (We have only MARKET & LIMIT ORDER JSONs). Currently, we have only ‘B’ & ‘S’ orders which are not sufficient to trade with., please implement all the trading transaction set in Algo trading as well. Because, Trader wants to cut the losses quickly, if in Loss.,. Mainly we need the SL-M orders (which surely cant be replaced with ‘B’ & ‘S’ transaction type orders.

Thanks @sakthivel.info11 - awesome feedback there! Can you drop us a note on api@dhan.co - both me and @Naman are on this, we would want to understand more of these use-cases. A updated version of webhooks is already in works.

Hi Sakthivel, Can you try putting the alert_msg into comment section of strategy.entry and create a webhook alert. Give {{strategy.order.comment}} in message box of the webhook alert window. It should work for you.

1 Like

Hi @PravinJ & @Naman ,

Thank you so much for the replies.,. :star_struck: .,Today, i took the Realtime snaps for the use-cases. And I have attached in the mail.

As I informed earlier, I kindly requesting to implement two main use cases which really required for Algo Traders. I have sent a mail to api@dhan.co .,. Kindly implement the same.,. So that, it would be very beneficial to the Algo Traders.

Let’s Build Together!:wave:

Thanks
Sakthivel S.

1 Like

Hi @Rajendra ,

As per your suggestion, i passed the alert message in comment section of Strategy. Alerts perfectly triggered in TradingView. But it’s NOT reflecting in Dhan. Please verify the strategy alert() function & Alert_message variable belong to the PineScript strategy.entry & strategy.order, whether it’s working fine with Dhan.

image

//-------------------------------- LONG ENTRY -------------------------------------------------------------
if(close>open and OpenSession==1)
strategy.entry(“Nifty_Future_Buy”,strategy.long,qty=1,stop=ohlc4[2],comment=“”+str.tostring(alert_msg))

//-------------------------------- SHORT ENTRY ------------------------------------------------------------
if(close<open and OpenSession==1)
strategy.entry(“Nifty_Future_Sell”,strategy.short,qty=1,stop=ohlc4[2],comment=“”+str.tostring(alert_msg))

@Naman I have a strategy made NOT STUDY on TradingView which defines when to Short, Long and exit. Does Dhan allow direct order execution?

Also I am not able to add Community Scripts on tv.dhan.co. Is that not functional yet?

tv.dhan.co is a hosted trading library and won’t support community scripts.

Thanks for the quick reply - Is there anyway where in I can use the strategy created on TV native app and use it for orders execution?

Using Webhook - is not sufficient for a strategy because it has Buy, Sell, SL, Exit all involved.

1 Like

@Gangavarapu What would you suggest? I believe it is possible to do algo on TV Native but can it do directly when connected with Dhan?

Hi Hardik- Is the enhancement live now? I’m looking to place order for ATM options on a buy/sell alert.

Commodity Futures also work?