Webhook Queries

How to buy ce and then sell ce through webhook.

@t7support

Hello Brother,

I have a question, When we use trail stoploss and trail take profit in strategy conditions. usually trail stoploss exit conditions will moves the exits signals when the market moves in favor of it dynamically.

if we use a scalping strategy, most of the entries and exits will happen in the same bar.
in that case, exits will trigger and dynamically exits positions will change, by then Dhan will exit with the initial trigger and then the exit has shifted its position. so the back testing data will be very deceiving.

How to counter this issue? how about we use a buffer time conditions? i don’t want to use bar close for exit conditions as some trades will enter and exit in the same bar. and i don’t want to omit trail stoploss and trail take profit conditions in the strategy.

This query is applying stoploss viw webhooks.
Suppose I have a buy order of 5 lots which has been executed, now my stoploss has to be executed when the bar close below a horizontal line.

  1. How to do this via tradingview alerts and webhook.
  2. I tried this in past and that webhook added a new order of sell 5 lots instead of closing the earlier position of buy 5 lots.

If someone can please share the syntax that will be useful.

DId you find dynamic JSON for Dhan? i tried lot of way but i am not able to fire order. Alerts gets triggers well but ot order.

Hey @t7support @Hardik ,

For Futures trading, webhook order automation asks for Continuous Futures Symbol as visible in the below JSON generator screenshot.

But, when the current month symbol goes into Tender Period due to coming expiry then trader needs to choose the next month expiry.

So, in such case, how to trade next month expiry via webhook automation which expects a continuous futures symbol?

1 Like

The work around may be to modify the contract name to Silver2! as we approach tender period and move back to Silver1! after the contract expiry in code. We can give a configurable date in script settings to tell the code about the actual expiry day or tender period which the script can then use to do the roll over task.

1 Like

Hey @t7support @Hardik ,

While observing Continuous Futures on TV, I’m finding that M1 points to next month (July-05) futures but the current month (June-05) is not expired yet.

Is this normal?

Does TV continuous futures not consider actual expiry date before switching over to next month?

1 Like

Hello @hachiko

The 1! and 2! contracts on TradingView are continuous contracts. The contracts are changed as per the traded volume on a day basis, you can read more about it here: How is the switching date of contracts determined in continuous futures — TradingView India

If you want to keep it for a specific expiry, you can choose the same accordingly.

2 Likes