Error while placing order, 'errorCode': 'DH-906' " Account not enabled for Online Trading"

Hi Dhan Team,

Please help me with the below error of “Account not enabled for online trading” suddenly while placing order with Algo.

What is the reason for this. and how to resolve this.

Got exception in place_order as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-906’, ‘error_type’: ‘Order_Error’, ‘error_message’: ‘Account not enabled for Online Trading. Please contact Customer Care’}, ‘data’: {‘errorType’: ‘Order_Error’, ‘errorCode’: ‘DH-906’, ‘errorMessage’: ‘Account not enabled for Online Trading. Please contact Customer Care’}}

Hi @Samis,

Tagging @Dhan .

'Got exception in place_order as {‘status’: ‘failure’, ‘remarks’: {‘error_code’: ‘DH-906’, ‘error_type’: ‘Order_Error’, ‘error_message’: ‘Market is Closed! Want to place an offline order?’}, ‘data’: {‘errorType’: ‘Order_Error’, ‘errorCode’: ‘DH-906’, ‘errorMessage’: ‘Market is Closed! Want to place an offline order?’}}

@Dhan plz resolve @Tradehull_Imran

no reply

Hi @ren ,

The order has not been placed since market was closed.
‘errorMessage’: ‘Market is Closed! Want to place an offline order?’

You can try placing AMO order.

Microsoft Windows [Version 10.0.22631.4751]
(c) Microsoft Corporation. All rights reserved.

E:\masterclass 1 to 9\5. Session5- Python Part 2\5. Session5- Python Part 2\Ltp Based Strike Selection>py Dhan_websocket.py
Reading existing file all_instrument 2025-03-06.csv
Watchlist changed. Reconnecting the feed…
Disconnected from WebSocket feed.
Authorizing…
Authorization successful!

thank you

plz excel not updating how is main reason @Tradehull_Imran

Hi @ren ,

Websocket is a old method we used to get LTP,
Now we have upgraded to a easier method to fetch LTP and also some fixes were applied in historical data as well.

Follow the below steps:

  • Open Command Prompt: Press Win, type cmd, and press Enter.
  • Install Dhan-Tradehull: Run pip install Dhan-Tradehull
  • Confirm the installation by running pip show Dhan-Tradehull

Guide to use the updated codebase:
Video reference : https://www.youtube.com/watch?v=P9iPYShakbA

Refer the below pypi link for more details:
https://pypi.org/project/Dhan-Tradehull/

1 Like

next video you are using excel but i cant open fetch data, plz solution for that, how to connt with new code

@Tradehull_Imran

Hi @ren ,

Could you elaborate your issue?