Hello @killedar.amit
What is your query here? Let me know and would be happy to help you out here.
Hello @killedar.amit
What is your query here? Let me know and would be happy to help you out here.
I will break the questions.
If I take options call buy position, how do I exit this position through use of webhooks , I mean for auto trading.
Can you explain this with an example.
Regarding the pdf document attached explaining how to do webhooks based trading, detailed explanation is required by using the pinescript strategy.
Is it ok, if I send the pinescript strategy to dhan for updating this to suit dhan webhook training automatically.
Call buy Entry
Put buy Entry
Stop loss and target
Thank you for breaking down your query.
For auto trading, you can place another alert which will square off your position (‘Sell’ to square off long position and vice versa) when your first alert is triggered. This can be based on any condition.
For example, if your first order is placed on 30 MA crossing over 50 MA from below, you create first trigger, which is triggered immediately for a particular strike price. Now, simultaneously, you create another alert which specifies that when 30 MA crosses 50 MA from above, then the next alert is triggered(which will be to square off your existing position) with earlier strike price.
Explained above with example. Do note that strike selection is done once and both the alerts are created, but with different triggers.
Yes, this is noted. However, it is difficult to provide PineScript explanation in a PDF. We will soon add other material to help here.
Unfortunately, we won’t be able to assist you here. However, there are some resources on community that you can use to customise on your own.
Hardik
Thanks, understood and try as per above.
While this workaround of webhooks is good and gets the job done for trading options through TV.
But the real game changer would be to see option charts on TV.com where users can utilize the community scripts and pinescript to build own indicators specifically to use on options charts.
Currently, tv.dhan.co displays option charts but it is missing the smarts of TV i.e. community scripts and pinescript and lets face it TV charts are slick like no other platform is offering may be its their tech stack.
Anyway, since dhan already has an ongoing partnership with TV and this partnership is bringing industry first features like ad-free version and so on, can you work with TV to find a way to stream dhan data feed to TV platform. That way TV users who can login to TV with Dhan credentials will be able to search and see all the scrips that are currently being provided on tv.dhan.co or dhan. This way users can search for options charts on TV search bar and load the charts.
Order placement module is already there. Once users get dhan data stream in TV this will be the real game changer and will be a perfect marriage made in heaven because users will get the best of both worlds, data feed from dhan and charts from TV.
Currently, TV already features separate data feed packages as add-ons above their premium subscription, so in that list Dhan data feed can also start appearing.
Im sure your team might have already considered this, but I still have to ask this to push you into trying this again as you are already working with TV and they listen to you for bringing never before features like ad-free, so Im hoping they will also listen to you to bring dhan data feed to TV.
Hardik
I created 4 option orders on webhooks
Call buy 47400 for entry
Call Sell 47400 for exit
Put buy 47200 for entry
Put sell 47200 for exit
In this case, it triggereed the exit orders first due to this condition met first.
Also it was taking option selling order for exit condition.
Am i missing something here…
I was looking for auto trading…
@dhingrab
As you may know, TradingView.com is a global charting platform and leader in the segment. TV already procures data directly from NSE, and is registered to distribute as well.
Their decision to not have Option contracts in Indian markets is because of challenges that they are already working on. Also, on point of us providing additional data feed to them, there are regulations around this and as mentioned, TradingView procures data themselves.
Thank you for your kind words and the push!
@killedar.amit
Can you elaborate something on how did you place these alerts? Were the entry and exit condition on single JSON or separate ones.
In case you placed all this alerts on your condition, there might be scenario where your option selling happens before option is bought, depending on which condition is met. If you are using Indicators to place this, it is better to not place both entry and exit condition at once.
The entry and exit were on single jsons.
I created conditions for both entry and exit with webhooks order at a time since i m looking for auto trading for options.
Hey @killedar.amit
Just to confirm, the entry alert and exit alert were two different alert with conditions and separate JSON for each alert as well?
Yes correct, 2 different jsons
Understood. So when alerts are triggered and we receive the webhook message from TradingView, we do not know whether it is for entry or exit position, as all messages are taken as a fresh order.
What you can do is either use Pinescript and generate exit alert only after entry alert is generated or manually place exit alert after entry alert.
In this method we have select option strike beforehand. But what is the way to select random strike based on underlying like ATM OR ATM+3 OR ATM-4??
Hello @9978442050
Dynamic strike selection is not enabled on JSON yet. However, you can use TradingView Pinescript for the same, wherein you can custom input Strike
value in JSON.
Hello @msj
Over here, there is no way to check existing position as the entire mechanism works on webhook message that we receive on our end.
To handle multiple alerts, TradingView does have a feature if you are using Pinescript : alert.freq_once_per_bar
. If you are using direct alerts, you can use ‘Only once’ option while creating the alert.
Team,
I am getting a strange error of syntax on secret
Please help, i am not sure do i need to define variable as secret with zero value in code.
Syntax is wrong plz read pine documentation on how to construct string.
Dear All,
For the benefit of equity lovers at Dhan HQ,. With due respect to all traders out there, I have published a basic trendline indicator. Its just a basic one to start your algo journey, which can easily be integrated with Dhan Webhooks.
I have included tooltips for you to easily understand how to integrate with Dhan. But if you still have doubts, please reach out to me at Telegram at @Pavan_BreathEasy
Its’s closed source since many culprits out there steal the good codes and sell them for money. considering it made the decision to publish as closed source.
Anyone can access this indicator and start earning.
IF YOU LIKE THE INDICATOR, PLZ LIKE AND COMMENT WITH CHEER.
SPREAD LOVE SPREAD INDICATOR.
could you please share some example or can help me in correcting the code. I am very poor in developing code
after alert_message = use sing quotes instead double quotes. at the end also use single quote.