(Resolved) Error while placing order error code DH 906 ‘errorType’: ‘Order_Error’, ‘errorCode’: ‘DH-906’, ‘errorMessage’: ‘Transactions Fails.’}}

'Got exception in place_order as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-906’, ‘error_type’: ‘Order_Error’, ‘error_message’: ‘Transactions Fails.’}, ‘data’: {‘errorType’: ‘Order_Error’, ‘errorCode’: ‘DH-906’, ‘errorMessage’: ‘Transactions Fails.’}}

Hi team, I have been getting this message.

I have gone with this code below:

raw = tsl.get_ltp_data(ce_name)

example raw is like {‘NIFTY 02 DEC 26250 CALL’: 32.8}

ce_entry_price = float(raw.get(ce_name)) # ref: 32.8
print(" ce Entry Price:", ce_entry_price)
total_quantity = 75
ce_sp_3 = (ce_entry_price * 0.01)
ce_sp_3 = round(ce_sp_3, 1)
tgt3_ce = round(ce_sp_3 + 0.05, 2)
ce_stop_loss1 = (ce_entry_price * 0.05)
ce_sl = round(ce_stop_loss1, 1)
sl_ce = round(ce_sl + 0.02, 2)
ce_target_3_orderid = tsl.order_placement(tradingsymbol=ce_name,exchange=‘NFO’,quantity=total_quantity,price=0,trigger_price=0,order_type=‘MARKET’,transaction_type=‘BUY’,trade_type=‘BO’, bo_profit_value=tgt3_ce,bo_stop_loss_Value=sl_ce)

it is able to make print all the values. Except that order is not getting placed!

What are the issues? I have funds upto 60K

Can you help? @Tradehull_Priya

I am sharing the O/P as well for reference:

pe_name:NIFTY 02 DEC 26100 PUT| strike:26100 PE Entry Price:43.4 BO Profit Value :43.85 BO StopLoss Value :41.25------------------------------------'Got exception in place_order as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-906’, ‘error_type’: ‘Order_Error’, ‘error_message’: ‘Transactions Fails.’}, ‘data’: {‘errorType’: ‘Order_Error’, ‘errorCode’: ‘DH-906’, ‘errorMessage’: ‘Transactions Fails.’}}

Hi @Amey_Nandgaonkar ,

Dhan’s BO orders don’t accept price levels or percentages for profit/SL.
Their API requires boProfitValue and boStopLossValue to be sent as point-difference values (absolute change from entry price).
Also, BO orders must be LIMIT orders, meaning you need to pass the actual entry price.
If these values are too small or not in the expected format, the RMS engine rejects the order with DH-906.

That’s why your order is failing even though the rest of your code is correct.

Hello Sir,

Can you please share the reference Code for this. I have made several tries including limit order. Yet it is giving the same msg.

Hi @Amey_Nandgaonkar ,

Do refer the below code-

bo_orderid = tsl.order_placement(tradingsymbol = 'NIFTY 09 DEC 26000 PUT', exchange = 'NFO', quantity = 75, price = 0, trigger_price = 0, order_type = 'MARKET', transaction_type = 'BUY', trade_type = 'BO', bo_profit_value=5, bo_stop_loss_value=5)

Good Morning Sir, @Tradehull_Imran

I will share 2 instances.
I went ahead with LIMIT, then with MARKET.
I have used NIFTY16 DEC 25500 PUT as the trading symbol

Yet the same error.

Is this error from Dhan Side?

Hi @Amey_Nandgaonkar ,

At the moment, Dhan has disabled both Bracket Orders and Cover Orders.