Hi,
I need some help with the Webhooks with Tradingview.
I have 2 alerts on Tradingview “Buy” and “Sell”. When “Buy” alert is triggered, it takes a long position on Dhan (which is fine), but let’s say
If the “Buy” alert is triggered again before the “Sell” alert is triggered, in this case I don’t want to add up another qty. System should check if we already have a long position, it should not add another.
Now when the “Sell” alert is triggered, it will exit the open position (which is fine too) but, this time I want to take the sell position immediately after exiting the Long position and vice a versa.
This is already tested and working on 3rd party app but how to make it work on Dhan Webhook !!
Not possible. Tradingview pine code doesn’t have any way to check your open positions. Webhook also just relays u r alert string to Dhan. It therefore cannot do any action based on u r actual open positions.
If u r sell alert occurs immediately after buy alert or vice-versa the buy and sell orders will get executed immediately one after the other. So this aspect should really be managed at TV pine script end.
Thanks for your suggestion.
I have uploaded a picture below of a third party application Algoji that is connected with both Tradingview and Dhan. This application itself provides the safety to not take additional orders when the order type is the same.
Question is can the developers at Dhan provide this feature in the Json to check if the repeated order is sent via webhooks !