Build and Backtest any Intraday Strategy in Python
Learn how to build and backtest any technical indicator-based intraday strategy using Python
This guide is a set of detailed tutorials that teaches you a framework I have been using for the past 4+ years to backtest my intraday strategies using Python.
I have condensed all of my learnings while building strategies for myself and implementing them in real market scenarios and you will learn it by implementing these widely used and most effective strategies by intraday traders.
What will you learn?
- Detailed explanations of the indicators used and background of the strategies.
- Using the Yahoo Finance database to access stock market data.
- Implement the strategy on the entire time horizon and simulate returns for days in which trades were placed.
- Optimizing your strategy further by implementing money market rules and getting more precise backtesting results
- Detailed observation of strategy results to see further scope for optimization.
All of this using the power of Python! It gives you the complete framework to do all of it in a plug-and-play format.
What do you mean by plug-and-play?
You can use these notebooks to backtest any stock listed on any major stock exchange in the world. All you need to do is alter your choice's time frame and stock and run the notebooks.
Can you use this to backtest using other strategies of your choice?
All you need to do is replace indicators of your choice with the existing ones and replace the strategy conditions for Buy and Sell based on your logic and you are good to go.
Moreover, these strategies and most importantly the backtesting framework I discuss here don't just apply to stocks but also to a wide variety of traded assets.
What you'll be building (some snippets):
Why Python?
Python is one of the most versatile programming languages there is. It is powerful, simpler to understand, and has a large and diverse pool of developers that write and maintain code.
Particularly when it comes to Finance, it is the first choice language among Algo traders and Quantitative Developers. Given that the python community in finance is so huge, it makes it much easier to build and maintain your systems in python.
This guide is for you if :
- You have a basic understanding of Python programming or programming in general
- You use technical indicators to make buy/sell decisions in financial markets
- You are a programmer and just getting started with trading in financial markets
- You are an experienced trader using technicals and just getting started with programming
Are there any prerequisites?
- Python computing stack installed on your local machine. You can download and install Anaconda or even use Google Colab.
- Basic understanding of programming in general or python programming language
- Basic understanding of financial markets
September 2023 Update: The code for all the strategies in this guide have been updated for bug fixes and enhancements in methods.
Includes PDF with detailed explanation of technical indicators, 5 ready-to-use Jupyter Notebooks with detailed step-by-step explanations of code, a ReadMe file with other important information