Option_Chain_Replay

import pdb
import time
import datetime  # Single import for datetime
import traceback
from Dhan_Tradehull import Tradehull
import pandas as pd
from pprint import pprint
from nsetools import Nse
# Excel & Visualization
import xlwings as xw
import matplotlib.pyplot as plt  # type: ignore



client_code = "1103728918 "
token_id    = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJkaGFuIiwicGFydG5lcklkIjoiIiwiZXhwIjoxNzQ3OTg5MzUxLCJ0b2tlbkNvbnN1bWVyVHlwZSI6IlNFTEYiLCJ3ZWJob29rVXJsIjoiIiwiZGhhbkNsaWVudElkIjoiMTEwMzcyODkxOCJ9.XchV1EkFmrdSesCTQqpMoALVlB-TJkJz65-Wb_5bW8z_z67lQVcE5JU6sqE2J6n9koAPxlkf6pKpAPbX5dAPEA"
tsl_dhan    = Tradehull(client_code, token_id)


watchlist = ["HDFCBANK", "ICICIBANK", "NTPC" ]



for name in watchlist:
    chart = tsl_dhan.get_historical_data(tradingsymbol=name, exchange='NSE', timeframe="15") 
    print(name)
    print(chart)

chart = tsl_dhan.get_historical_data(tradingsymbol='NIFTY', exchange='INDEX', timeframe='15')
print(name)




kindly help to resolve the issue ( active API Details mention in above code)

actually i wan to run Option_Chain_Replay ( for expiry option greeks) (advance algo series Session 9)

API Subscribe on 23 April 25 ( Status shown Active )
even reinstall and update python but still same issue to get option data or ltp

Hi @hbdesign31 ,

The issue may probably from API end. Have tagged them in MadeforTrade community.

Also try to delete the existing access token and create new one and try.

Just to clarify, I’ve already tried generating a new access token, but the issue remains unresolved.

I also spoke with Dhan support, and they mentioned that since we’re currently using the TradeHull library, they’re unable to verify the issue from their end. They advised using the official Dhan library for further support and compatibility checks.

Could you please let me know if there’s any workaround or if migrating to the Dhan library is necessary to proceed?

Looking forward to your input.

Hi @hbdesign31 ,

You may consider switching to the Zerodha API. Also, Zerodha has recently reduced the API subscription cost from ₹4000 to just ₹500, making it a much more economical option to explore.