Webhook Order not Placed

Hi @Hardik /@Dhan

Hope you are doing well.

I have defined the long and short positions in the pine script and also defined conditions to buy and sell options.
Today on 11:30 long ordered tiggered and the order was placed on dhan ,the json message was -" {“secret”:“YtdEY”,“alertType”:“multi_leg_order”,“order_legs”:[{“transactionType”:“B”,“orderType”:“MKT”,“quantity”:“1”,“exchange”:“NSE”,“symbol”:“BANKNIFTY”,“instrument”:“OPT”,“productType”:“I”,“sort_order”:“1”,“price”:“0”,“option_type”:“CE”,“strike_price”:“51800”,“expiry_date”:“2025-01-29”},{“transactionType”:“S”,“orderType”:“MKT”,“quantity”:“1”,“exchange”:“NSE”,“symbol”:“BANKNIFTY”,“instrument”:“OPT”,“productType”:“I”,“sort_order”:“2”,“price”:“0”,“option_type”:“CE”,“strike_price”:“52300”,“expiry_date”:“2025-01-29”}]} "

But at 01:27 pm short ordered was tiggered with jason message - “{“secret”:“YtdEY”,“alertType”:“multi_leg_order”,“order_legs”:[{“transactionType”:“B”,“orderType”:“MKT”,“quantity”:“1”,“exchange”:“NSE”,“symbol”:“BANKNIFTY”,“instrument”:“OPT”,“productType”:“I”,“sort_order”:“1”,“price”:“0”,“option_type”:“PE”,“strike_price”:“51000”,“expiry_date”:“2025-01-29”}”,{“transactionType”:“S”,“orderType”:“MKT”,“quantity”:“1”,“exchange”:“NSE”,“symbol”:“BANKNIFTY”,“instrument”:“OPT”,“productType”:“I”,“sort_order”:“2”,“price”:“0”,“option_type”:“PE”,“strike_price”:“50500”,“expiry_date”:“2025-01-29”}]}"

But the orders was not placed on dhan with same URL and security key and i can’t find any reason behind it and it has made me confused because i dont know what error/bug has casued this issue, Could you please provide some assistance on this issue.

Thanks & Regards
Mayank

Hello @Mayank_Sharma1

Welcome to MadeForTrade community!

Can you check the validity of the URL and also, the secret mapped to it. For background, whenever URL is changed, the secret is also changed.
This is one of the reasons for orders to not get placed, assuming you haven’t made any manual changes to the JSON.

Hi @Hardik

Probably the problem is solved, the issue appears to be caused by an extra double quotation mark at the beginning of the second-order sequence. This discrepancy was only present in the short-side JSON format, as the long-side format remained correct.

1 Like