(Pdb++) data = tsl.get_expired_option_data(tradingsymbol=name,exchange=“NFO”,interval=1,expiry_flag=“WEEK”,expiry_code=1,strike=“ATM”,option_type=“CALL”,from_date=from_date,to_date=expiry)
*** AttributeError: ‘Tradehull’ object has no attribute ‘get_expired_option_data’
Getting this error while executing the code. pl guide sir.
hi ,
i do have a dhan account , i am able to generate the access token and at last the csv files also in my system.
but the issue is they are coming up as 1 kb files and there is no data in it .
what do i do PLEASE GUIDE.
I created algo strategy and storing trade log history for trades taken. I am trying to calculate ROI% metric and facing some challenges in calculating capital/margin used by strategies.
For simple equity or option buying trades calculation is simple like Qty * Buy price.
But when I am trying to calculate it for complex options strategies like Bull Call Spread, Short Iron Condor, or Straddle then I am unable to calculate accurate margin value which is visible on Dhan Options portal.
Is there any way to calculate it using Python program or Dhan api? It should match with Dhan Options platform.
Thank you for your response it worked and I am able to get more accurate numbers now.
Your memory is so sharp you still remember my name even after long time.
I was not active on community but I was continuously watching your videos on youtube and building my own platform which is almost complete now.
Keep sharing your knowledge with us about Algo Trading its really helpful. Appreciate your efforts and Dhan!
Dhan data is different from Tradingview, Zerodha and Chartink! I backtested my strategy on Tradingview and was going to get data from Dhan API but I am seeing mismatches in the data! I just want to know whether this mismatch is in the chart only or also in the data. (I am unable to attach more than one image)
Close price of GODREJCP 5min candle opened at 9:35
Dhan : 1042.8
Tradingview : 1042.3
Chartink : 1042.3
Zerodha : 1042.3
All platforms are technically correct. as each platform captures snapshot data per candle from lakhs of actual ticks, so OHLC values will naturally vary slightly between platforms.
like in the quoted example, prices differ by 2-3 ticks, which is nearly 0.05% variance
To get a more aligned data, we may backtest and make live algo using Dhan api, so that platform remains same, and we can remove the slight variance by this method
Very Good Morning Sir. You have started another New series: ‘AI and Algos by Dhan’ I could not traceout the code snippets of these series. What exactly the link, if I have missed them to traceout sir. Thanks a lot sir for all your efforts at Dhan.
token_id – I couldn’t find any place to paste the token_id. Is there a specific line or option where it should be added?
9. Dhan_Tradehull.py
client_code – I couldn’t find any place to paste the client_code.
token_id – I couldn’t find any place to paste the token_id.
Dhan Data API Monthly Plan (₹499/month) – Purchased
1 Ran the command:
pip install dhanhq==2.2.0
but it shows some errors.
Issue- Excel data is not updating.
Issue- Excel is not opening.
Could you please check the attached screenshots and help me identify what is causing these issues? I would appreciate your guidance on how to fix them.