Learn Algo Trading with Python | Codes | Youtube Series

@Tradehull_Imran

Hi, Please ignore this post. I am able to resolve it after changing the below two lines, it’s my bad. Anyhow, thanks for the support so far.

client_code = sheet.range(‘C_CODE’).value
token_id = sheet.range(‘TKN_ID’).value

1 Like

Hi @Md_Naquibuddin

As of now use dhanhq 1.3.3
I will be releasing a separate video for Dhan_tradehull_v2 which will have support for dhanhq 2.0.0

Hi @Hitesh_Maurya
This question is being covered in upcoming video for Dhan_Tradehull_V2

@Jyothi_Chilukoti
In Dhan_Tradehull_V2 , there is a new way to get LTP, mostly this issue will be fixed after that.

1 Like

@Tradehull_Imran
Hi, I have two quick questions:
Is there any way to pull previous day values in the Excel file, like Previous day - open, high, low and close?

Can we place orders from the Excel file based on meeting a criteria or condition?

Hi @Jyothi_Chilukoti

  1. Yes now in Dhan_Tradehull_V2 we can get previous day data as well.

  2. Yes on meeting some conditions orders can be sent through the excel.

1 Like

@Tradehull_Imran
Hi, Could you teach us or provide more info on how to place orders from the Excel file, I am very much interested to know this feature.

@Jyothi_Chilukoti
Added in upcoming_videos_list.

1 Like

Please provide download link for Dhan_Tradehull_V2.
Please share it.

Hi everyone,
Development for Dhan_Tradehull_V2.py is completed,
Also the codebase release video will be shared by Thursday.

This will solve majority of the problems that are currently being faced.

3 Likes

thanks for your kind reply.
I am waiting for your next video eagerly . When will your next video come…???

1 Like

when are you going to launch remaining videos??? please teach Trailing stoploss and Target order as well… Thanks

1 Like

we could say this , but ifWe recognize that in fast-moving markets, it can be challenging to determine which option strike price will yield the best profit in real time. This ascending option selection chart addresses that need by automatically identifying and displaying the most profitable strike price based on the current spot price movements. By following the spot chart closely, this tool pinpoints the optimal strike for immediate buying or selling, eliminating the guesswork and enabling traders to capitalize on high-potential opportunities effortlessly. Whether the market is bullish or bearish, the chart dynamically updates to reflect the best possible strike, aligning with the trader’s objectives and maximizing profitability."

This version emphasizes the tool’s utility in real-time trading scenarios and its potential for profitability while reassuring that it simplifies decision-making. we also could minimise this option selection by automatically highlighting the 2 ATM, 2 OTM, and 2 ITM strikes with the highest probability of profit (POP). It updates in real-time based on spot movements, allowing traders to quickly identify the most profitable opportunities without the need for manual analysis.

1 Like

Running strategy in While True: , will that hit api rate limit very quickly? or we can run the strategy till market hours?

@Tradehull_Imran While running the “Dhan_websocket.py” I am getting the below errors, please help me with the errors…

WebSocket connection error: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’
Reconnecting Again…WebSocket connection error: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’
Reconnecting Again…WebSocket connection error: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’
Reconnecting Again…WebSocket connection error: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’
Reconnecting Again…WebSocket connection error: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’
Reconnecting Again…WebSocket connection error: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’
Reconnecting Again…WebSocket connection error: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’
Reconnecting Again…WebSocket connection error: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’
Reconnecting Again…WebSocket connection error: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’
Reconnecting Again…Traceback (most recent call last):
File “D:\Python_Project\Dhan_websocket.py”, line 78, in run_feed
data = marketfeed.DhanFeed(client_id, access_token, instruments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “D:\Python_Project\Dhan_websocket.py”, line 78, in run_feed
data = marketfeed.DhanFeed(client_id, access_token, instruments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “D:\Python_Project\Dhan_websocket.py”, line 78, in run_feed
data = marketfeed.DhanFeed(client_id, access_token, instruments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “D:\Python_Project\Dhan_websocket.py”, line 78, in run_feed
data = marketfeed.DhanFeed(client_id, access_token, instruments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: DhanFeed.init() missing 1 required positional argument: ‘subscription_code’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “D:\Python_Project\Dhan_websocket.py”, line 145, in
main_loop()
File “D:\Python_Project\Dhan_websocket.py”, line 142, in main_loop
run_feed(client_id, access_token, instruments)
File “D:\Python_Project\Dhan_websocket.py”, line 130, in run_feed
run_feed(client_id, access_token, instruments) # Retry the connection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Project\Dhan_websocket.py”, line 130, in run_feed
run_feed(client_id, access_token, instruments) # Retry the connection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “D:\Python_Project\Dhan_websocket.py”, line 130, in run_feed
run_feed(client_id, access_token, instruments) # Retry the connection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Previous line repeated 995 more times]
RecursionError: maximum recursion depth exceeded

D:\Python_Project>

It depends,

In case rate limits are breached, use

import time

time.sleep(0.3) # wait for 0.3 seconds before getting next data

Hi @Samis
Let me know your dhanhq version

on cmd send the command

pip show dhanhq

Hi @Tradehull_Imran Sir, please find the output for dhanhq version

D:\Python_Project>pip show dhanhq
Name: dhanhq
Version: 1.3
Summary: The official Python client for communicating with the Dhan API
Home-page:
Author: Dhan
Author-email: dhan-oss@dhan.co
License: MIT LICENSE
Location: C:\Users\samis\AppData\Roaming\Python\Python312\site-packages
Requires: pandas, requests
Required-by:

D:\Python_Project>

Hi @Samis

  1. Upgrade Dhanhq version
    pip install --upgrade dhanhq
  1. and Use this file
    https://drive.google.com/file/d/1oBwi_HlXhMa-SU40W4o9uUCSWi9XVLOH/view?usp=drive_link

Can anyone help me to get last 2 months Banknify historical data for 5min and 15mins

@Tradehull_Imran ??