Learn Algo Trading with Python | Codes | Youtube Series

Session 8 codefiles: 8. Session8- 2nd Live Algo.zip - Google Drive

Thank you so much sir , for your support and patience

1 Like

Sir, the video for session 8 hasn’t been uploaded to YouTube yet… but you’ve already given us the code… Sir, will the video for session 8 not be uploaded?

Hi @Md_Naquibuddin
yes, it would be uploaded , you may try the code till then


Here’s the translation:

“When we are running your 8th session’s dhan_websocket, only this is coming up… data is not updating… and we are doing this during market hours… please tell us the solution, sir.”


Hye @Tradehull_Imran

This code is running well but only buys 1 stock, but we have already defined qty conditions, what is the issue?
And I get this message in cmd : single positional indexer is out-of-bounds

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

On my end code seems to be running fine

Hi @Zee2Zahid

I am bit unclear about your question

  1. If the code only buys 1 scripts
    maybe entry conditions on remaining scripts are not fulfilled

  2. Not clear on this : “but we have already defined qty conditions”

  3. “single positional indexer is out-of-bounds”
    if this error does not breaks the program then its still okey
    if it breaks the program and makes exit, then its a issue
    in that case do send me screenshot

Hi Everyone,

We are updating Dhan_Tradehull codebase to Dhan_Tradehull_2.0.0

Below are the updates we will be releasing

  1. Updates in Historical data
    a. Support for pervious day intraday data, example previous day 5 mins candles
    b. Single Historical Api call for “1 day” and “Intraday timeframes”

  2. REST api call for LTP
    a. For “easier access to LTP” without the use of webscokets
    b. This will be bulk api call, so we can get data for multiple scripts at 1 call onloy, no need to multiple calls

  3. Api calls to fetch orderStatus

  4. Api calls to fetch averageTradedPrice

  5. Codebase Support for commodity

  6. Installation fix for SSL issue

Let me know your views.

3 Likes

@RahulDeshpande @Dhan

When can we expect the Session 8 video to be released?

Moone Boy Waiting GIF by HULU

1 Like

@Tradehull_Imran ,
Thanks, it would be nice, we would get latest API.

Soon :slight_smile:

1 Like

Hi Sir, In session 8, you have provided, tradehull.py, websocket.py, multi time frame algo.py - Shall we have to use this websocket.py in place of the old one to overcome the problems. Righ sir.
What about the DhanHQ V2 sir. Nothing is to be changed?

I changed this
tsl.order_placement(stock_name,‘NSE’, 1, 0, 0, ‘MARKET’, ‘SELL’, ‘MIS’)

With

tsl.order_placement(stock_name,‘NSE’, qty, 0, 0, ‘MARKET’, ‘SELL’, ‘MIS’)

Then it took more then one quantity.

Code is working fine,but live PnL is not updating until websocket code is also kept running.

And I want to know how can we use SL orders, instead of market orders

Hi @Vasili_Prasad
Yes, these are the latest files, you can use them

Also using Dhanhq v2.0.0 below are the updates

  1. Api calls to fetch averageTradedPrice

  2. Updates in Historical data
    a. Support for pervious day intraday data, example previous day 5 mins candles
    b. Single Historical Api call for “1 day” and “Intraday timeframes”

1 Like

Hi @Zee2Zahid

  1. yes for pnl calculations WebSocket code needs to be kept on running
  2. for SL use this code
    # reference            
    order_placement(tradingsymbol, exchange,quantity, price, trigger_price, order_type, transaction_type, trade_type)
    sl_orderid        = tsl.order_placement(stock_name,'NSE', 1, 0, sl_price, 'STOPMARKET', 'SELL', 'MIS')

2 Likes

how to update Dhanhq v2.0.0

https://drive.google.com/drive/folders/12_zv_xJses0zW5VR7PNUujNPAq0sepK1?usp=sharing

Hi @Md_Naquibuddin
use below command on CMD

pip install --upgrade dhanhq==2.0.0

I m waiting for your reply