Learn Advanced Algo Trading Series | Codes | Youtube

Hi Folks,

Our Algo Trading Series, hosted by @Tradehull_Imran, has been incredibly well-received, benefiting 5,000+ traders so far with in-depth, practical insights.

Due to popular demand, we’re back with the second edition of the Algo Trading Series, designed to help our Algo Trading community systematically master advanced algorithmic trading concepts.

Video Series:

Episode 1: Introduction to Advance Algo Trading

Topics covered:
:one: Introduction to Advanced Algo Trading – The series builds upon the basics covered in the previous playlist, focusing on creating fully functional live trading algorithms.

:two: Pandas Library for Data Handling – The session covers how to use Pandas to process market data efficiently, including sorting, filtering, and calculating indicators like moving averages.

:three: Technical Indicators & Customization – Explains how to apply and customize technical indicators such as SMA, Bollinger Bands, MACD, RSI, and Supertrend using Python’s TA-Lib.

:four: Candlestick Pattern Recognition – Demonstrates how to detect common patterns like Doji, Marubozu, and Engulfing patterns programmatically using Python.

:five: Foundation for Building Scanners & Strategies – Sets the stage for the next sessions by discussing how to create personalized scanners and automate strategy execution using algorithmic trading concepts.

Codes: Session 1: Introduction to Advance Algo Trading

Episode 2: How To Create A Scanner & Scanning Option Chain

Topics covered:

Summary: Advanced Algo Trading Series | Episode 2

:pushpin: Introduction to Scanners in Algo Trading

  • Understanding the difference between a scanner and an algo
  • Scanners help identify trade opportunities; algos handle order execution

:pushpin: Creating Different Types of Scanners

  • Basic Scanners: Normal scanner and option chain scanner
  • Indicator-Based Scanners: Using RSI, Supertrend, and candlestick patterns
  • Price Action-Based Scanners: Implementing bullish and bearish engulfing patterns

:pushpin: Building Heikin Ashi & Renko Charts

  • How to convert candlestick data into Heikin Ashi and Renko charts
  • Applying indicators like Supertrend on these charts

:pushpin: Debugging & Testing Scanners

  • Importance of backtesting scanners before live deployment
  • Using print statements and debugging techniques to fix scanner issues
  • Handling errors when stock symbols change or data isn’t available

:pushpin: Option Chain Scanning

  • Understanding the importance of API access to real-time option chain data
  • Fetching option chain data for index and stock options
  • Extracting ATM (At-the-Money) strike prices

:pushpin: Selecting Strikes Based on Data Metrics

  • LTP-Based Selection: Finding strikes with LTP below a certain value
  • Volume & Open Interest-Based Selection: Identifying strikes with the highest volume or OI
  • Change in Open Interest: Spotting potential trend shifts
  • Put-Call Ratio (PCR) Calculation: Using volume and OI to gauge market sentiment

:pushpin: Strategic Approach to Algo Trading

  • Learning fundamental concepts before combining them into an advanced algo
  • Step-by-step approach to integrating scanners, indicators, and execution strategies

:link: Watch the Full Video Here:

Session 2 codes: Session 2.zip - Google Drive

This session provides an in-depth, hands-on approach to creating scanners and working with option chain data—ideal for traders looking to automate their strategies! :rocket:

Episode 3: Advanced Algo Trading Series

:small_blue_diamond: Connecting Algo with Excel – Learn how to integrate Excel to view and control your algo’s decision-making process.
:small_blue_diamond: Automating Trade Execution – Execute buy/sell orders directly from Excel by inputting values.
:small_blue_diamond: Reading & Writing Data in Excel – Learn how to fetch live market data into Excel and track indicators like LTP, RSI, and entry conditions in real-time.
:small_blue_diamond: Managing Trades with API – How to execute, modify, and track orders dynamically.
:small_blue_diamond: Rate Limits & Optimization – Techniques to make your algo more efficient and avoid API rate limitations.
:small_blue_diamond: Creating a Mini RoboCop – Build a simplified trading bot that automates order placement & risk management via Excel.
:small_blue_diamond: Upcoming in Part 2 – Automating option chain updates and sending alerts via Telegram for key trade updates.

This episode is a must-watch for traders looking to bridge the gap between algo trading and Excel automation. :rocket:

Watch the video :point_down:

Stay tuned for the next episodes! From here on, we will upload two weekly videos for everyone to learn and implement!

Episode 3 codes: Session 3.zip - Google Drive

Episode 4: Framework of Live Algo

In Episode 4, we dive into building a structured framework for live algo trading, ensuring precision, scalability, and efficiency.

:small_blue_diamond: Key Highlights:

:white_check_mark: Blueprint for Live Algo – A structured approach to executing strategies seamlessly.
:white_check_mark: Managing Multiple Positions – Track & automate entries, exits, SL, and P&L dynamically.
:white_check_mark: Trade Execution & Monitoring – Build an order book system for real-time tracking.
:white_check_mark: Re-Entry & Risk Management – Avoid duplicate trades, implement trailing SL & pyramiding.
:white_check_mark: Testing & Debugging – Simulate trades before going live for smooth execution.

:rocket: Why Watch? Learn how to automate & scale your trading system with a powerful framework!
:point_right: Watch now for real-time coding & implementation! :movie_camera::fire:

Code files for Episode 4: Session 4.zip - Google Drive

Episode 5: Testing Your Algo

Code files: Session 5.zip - Google Drive

Episode 6 is now live!

Watch it here:

Here are the codes:

Epsiode 7 is now live:

Here are the codes:
Session 7.zip - Google Drive

Episode 8:

Here are the codes:

Episode 9 :

Here are the codes:

Episode 10 :

Here are the codes:

Episode 11 :slight_smile:

Here are the codes:

As usual, @Tradehull_Imran will be there to help you with any doubts!

22 Likes

Hi @RahulDeshpande ,
FYI,

This link is not working.
It is redirecting to,
https://github.com/TradeHull/Dhan_Tradehull

Episode 2: How To Create A Scanner & Scanning Option Chain session 2 codes is now up!

Hope you all are liking this series till now.

8 Likes

Yes, I have already Watched 2 Episodes. Thanks to Imran Ali sir, for his sincere efforts in explaining the concepts. I have to make in depth study and try using the codes.
Thanks again to the Dhan/TradeHull Team involved in developing and making the interested people to learn.
VBR Prasad

2 Likes

Episode 3 is now LIVE!

The topic can be of interest to a lot of algo trading enthusiasts:

1 Like

Very Good Morning Sir,
May I know the reason for not Using: Dhan_TradeHull_V2 is not imported . What’s the reason sir?
VBR Prasad

1 Like

Dear Imran Sir, Greatest content you are producing for indian learners…
I would request please help us in reply, How to code for Trailing stop loss once SL order is provided

1 Like

Also waiting for PART 2 of Episode 3 eagerly…
Thanks and Regards

Hello @Tradehull_Imran Sir,

I am trying to access the existing code which you provided in google drive

I am getting below error:

8. Tick By TICK Option Chain.py"
Codebase Version 3
-----Logged into Dhan-----
reading existing file all_instrument 2025-02-26.csv
Got the instrument file
Traceback (most recent call last):
  File "c:/Projects/Algo_Web/AlgoPython/AdvanceAlgo/8. Tick By TICK Option Chain.py", line 22, in <module>
    atm_strike, option_chain = tsl.get_option_chain(Underlying="NIFTY", exchange="INDEX", expiry=1,num_strikes=15)
TypeError: get_option_chain() got an unexpected keyword argument 'num_strikes'

I checked with latest Dhan_Tradehull lib file that get_option_chain() defination contains no parameter called num_strikes. Can you share latest Dhan_Tradehull lib file?

Thanks,
Sudip

Hi @Tradehull, I’m facing the same error as well. I’ve upgraded to Dhan_Tradehull version 3.0.5, but still facing the issue
Thanks

Hi Sir, Good Evening. While practicing the Episode 1, I have come across the following Error sir. How to resolve it?

At cmd Prompt:

(Pdb++) new_chart[‘high’][‘max’]
*** KeyError: ‘max’
Traceback (most recent call last):
File “C:\Users\RP\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\series.py”, line 1007, in getitem
return self._get_value(key)
File “C:\Users\RP\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\series.py”, line 1116, in _get_value
loc = self.index.get_loc(label)
File “C:\Users\RP\AppData\Local\Programs\Python\Python38\lib\site-packages\pandas\core\indexes\range.py”, line 349, in get_loc
raise KeyError(key)

https://madefortrade.in/t/i-got-error-while-i-write-right-code-which-sir-teach-for-scanning-option-chain/44446?u=skillet_flash

Hi @Tradehull_Imran ,

I’m facing issue with the HeikenAshi Candle,

using HA candle,
I want to print data of HighestHigh of Length 20.

Please help me out.

bai iam also facing same problem

sir provide session 4 code

pls add fibbonnaci sir

Hi @Akshay_Bawane ,

Do update the codebase, Use the below code:
pip install --upgrade Dhan-Tradehull

1 Like

Hi @SUDIP_NATH ,

Do update the codebase :
pip install --upgrade Dhan-Tradehull

Refer the below pypi link for more details:
https://pypi.org/project/Dhan-Tradehull/

@Tradehull_Imran
I am using mac os and don’t have excel on it. Is there any alternative that I can try for xlwings use case that you explained it in session 3?
Is it mandatory to use excel or we can achieve similar thing using some other approach?
Please assist me on this so I can follow you on next lectures. Currently stuck.