Learn Algo Trading with Python | Codes | Youtube Series

@Tradehull_Imran Sir I just run that code getting this error pls help.

Hi @CapTn_Mohit
Do send me complete zip of your folder, and share on the google drive link
share it with: tradehull_mentorship@tradehull.com

Hi @Vijen_Singh
you have posted your question in a nice formatted way, It becomes very easy in these cases for me the debug the issue.

I have tried the code, the issue seems in credentials, see if

  1. client_code, token_id is correct
  2. token_id is not expired

Hi @rahulcse56
For 2 mins timeframe see below solution

Hi @Harsh_Singh

  1. for Long buildup and covering , this algo will be covered in below thread
    Tick By Tick Algo for Option Chain with OI Buildup and Covering - #3 by Subhajitpanja

  2. In this case, OI or Volume is okey to detect high liquidity.

  3. It can be fetched with below code
    Live Market Feed - DhanHQ Ver 2.0 / API Document

  4. Issues with historical data has been solved now by Dhan_Tradehull_V2
    see below video :
    https://www.youtube.com/watch?v=HLiEpNZSD80

  5. This is solved, do check video in point no 4

  6. Sure, Trailing SL code is added in upcoming todo videos list.

2 Likes

Hi @Kishore007
This is a issue with WebSocket disconnecting, however the code reconnects itself when it happens
it can be safely ignored

Also now we don’t need webscoket to fetch the ltp.

1 Like

Hi @Msk92

  1. upgrading certifi package is a old solution,
    try point no 3 in below thread
    Learn Algo Trading with Python | Codes | Youtube Series - #177 by Tradehull_Imran

  2. Also certifi was required for WebSocket,
    now for an easier method, you can call LTP directly without using webscokets,
    this topic has been covered in Dhan_Tradehull_V2
    see below video for reference
    https://www.youtube.com/watch?v=HLiEpNZSD80

1 Like

Hi @Kuldeep_Khaladkar
Yes, V2 solves most of the issues
Going forward we will be using Dhan_Tradehull_V2 primarily and V1 will be deprecated

1 Like

Thank you, sir…

This Error Message can also be ignored !

The below Error Message came while running Multi timeframe Algo.

Hi Sir,

Please let me know how to fix this error… did i miss something ?
@Tradehull_Imran

Hello @Tradehull_Imran ,

How can we test any strategy on historical data for option trade with result profit / loss?

Thanks in advance

Hi @Kishore007
This needs to be checked, do run the algo in live market today to see if the same error is raised again.

Hi @Manish_Goel @rejithkoroth
Do check the below link for solution

Hi @SUDIP_NATH
This is covered under Backtesting in Algo Trading,

yes we can test the strategy for the last 7-8 years of data
optimize the best parameters that can be used for the strategy.

Hi Sir,
I have created the new token and completed the necessary updates. However, I am still encountering the issue as we discussed earlier.
Attached below is a detailed screenshot for your reference.


Thank you.

@Tradehull_Imran

Hi @Tradehull_Imran ,

I am getting below error while running the script,

can you please help to resolve this issue.

Thanks,
Devendra

Hi @ddeogharkar @rejithkoroth

  1. Do send me complete zip of your folder, and share on the google drive link
    share it with: tradehull_mentorship@tradehull.com

  2. Also send the output of the command on CMD pip show dhanhq

@Tradehull_Imran
Even after putting updated tradehull_v2 facing below error plz guide me.

Hi Sir,
@Tradehull_Imran The requested files have been shared it with the provided email.

Yes, sir

Error message is coming in live market , sir… !
But order is getting executed, sir…

reading existing file all_instrument 2024-11-11.csv
Got the instrument file
Traceback (most recent call last):
  File "C:\Users\Admin\Documents\Dhan\8. Session8- 2nd Live Algo\8. Session8- 2nd Live Algo\2nd live Algo\Dhan_Tradehull_V2.py", line 178, in get_live_pnl
    closePrice = ltp_data[underlying]
KeyError: 'Chambal Fertilisers & Chemicals'
MOTHERSON
OFSS
BSOFT
BSOFT is in downtrend, Sell this script
CHAMBLFERT
DIXON
DIXON is in downtrend, Sell this script
NATIONALUM
DLF
IDEA
ADANIPORTS
SAIL
HINDCOPPER
HINDCOPPER is in downtrend, Sell this script
INDIGO