Placing Stop limit or trigger orders using webhooks in Tradingview

Well I am trying to place a trigger order on SBI , say when SBI crosses 803 , while currently it is at 802.

Now have an alert in TV for same and using webhook to place order on Dhan.

On passing , the alert is getting triggered but no order is placed in Dhan.
This is webhook code.
{“secret”:“dpKdL”,“alertType”:“multi_leg_order”,“order_legs”:[{“transactionType”:“B”,“orderType”:“STOP_LIMIT”,“quantity”:“1”,“exchange”:“NSE”,“symbol”:“SBIN”,“instrument”:“EQ”,“productType”:“I”,“sort_order”:“1”,“price”:“803”}]}

If i use orderType as LMT , it works but then for OrderType STOP_LIMIT it is not working

How to place trigger orders using webhook.
Note: tried using STOP_LMT also

Hi @bhatiaaman

Welcome to the community.

The trigger order (stop loss order) & Webhook works in a same way. As the desired price is reached your order is triggered. The triggered order can be market order or limit order.

Therefore, use orderType as LMT or MKT for stop loss limit & stop loss market order respectively. Hope this helps

Thank for reply but I didn’t get it.
My scenario is I don’t want to place limit order. e.g say price of instrument is 800 , but I only want order to be executed if price crosses 805. If I place limit order at 805., it will be executed immediately.

In console we use TRIGGER order for same with trigger and limit price. How can I use webhooks to place Trigger order?

This u can do in pine itself. In strategy.order() use stop loss limit order. The alert will be fired only when this order condition is met. In JSON then you can specify a limit order.

https://www.tradingcode.net/tradingview/stop-limit-entry/