Book description
Build and backtest your algorithmic trading strategies to gain a true advantage in the market
Key Features
- Get quality insights from market data, stock analysis, and create your own data visualisations
- Learn how to navigate the different features in Python's data analysis libraries
- Start systematically approaching quantitative research and strategy generation/backtesting in algorithmic trading
Book Description
Creating an effective system to automate your trading can help you achieve two of every trader's key goals; saving time and making money. But to devise a system that will work for you, you need guidance to show you the ropes around building a system and monitoring its performance. This is where Hands-on Financial Trading with Python can give you the advantage.
This practical Python book will introduce you to Python and tell you exactly why it's the best platform for developing trading strategies. You'll then cover quantitative analysis using Python, and learn how to build algorithmic trading strategies with Zipline using various market data sources.
Using Zipline as the backtesting library allows access to complimentary US historical daily market data until 2018. As you advance, you will gain an in-depth understanding of Python libraries such as NumPy and pandas for analyzing financial datasets, and explore Matplotlib, statsmodels, and scikit-learn libraries for advanced analytics.
As you progress, you'll pick up lots of skills like time series forecasting, covering pmdarima and Facebook Prophet.
By the end of this trading book, you will be able to build predictive trading signals, adopt basic and advanced algorithmic trading strategies, and perform portfolio optimization to help you get —and stay—ahead of the markets.
What you will learn
- Discover how quantitative analysis works by covering financial statistics and ARIMA
- Use core Python libraries to perform quantitative research and strategy development using real datasets
- Understand how to access financial and economic data in Python
- Implement effective data visualization with Matplotlib
- Apply scientific computing and data visualization with popular Python libraries
- Build and deploy backtesting algorithmic trading strategies
Who this book is for
If you're a financial trader or a data analyst who wants a hands-on introduction to designing algorithmic trading strategies, then this book is for you. You don't have to be a fully-fledged programmer to dive into this book, but knowing how to use Python's core libraries and a solid grasp on statistics will help you get the most out of this book.
Table of contents
- Hands-On Financial Trading with Python
- Contributors
- About the authors
- About the reviewer
- Preface
- Section 1: Introduction to Algorithmic Trading
- Chapter 1: Introduction to Algorithmic Trading
- Section 2: In-Depth Look at Python Libraries for the Analysis of Financial Datasets
- Chapter 2: Exploratory Data Analysis in Python
-
Chapter 3: High-Speed Scientific Computing Using NumPy
- Technical requirements
- Introduction to NumPy
- Creating NumPy ndarrays
- Data types used with NumPy ndarrays
- Indexing of ndarrays
-
Basic ndarray operations
- Scalar multiplication with an ndarray
- Linear combinations of ndarrays
- Exponentiation of ndarrays
- Addition of an ndarray with a scalar
- Transposing a matrix
- Changing the layout of an ndarray
- Finding the minimum value in an ndarray
- Calculating the absolute value
- Calculating the mean of an ndarray
- Finding the index of the maximum value in an ndarray
- Calculating the cumulative sum of elements of an ndarray
- Finding NaNs in an ndarray
- Finding the truth values of x1>x2 of two ndarrays
- any and all Boolean operations on ndarrays
- Sorting ndarrays
- Searching within ndarrays
- File operations on ndarrays
- Summary
-
Chapter 4: Data Manipulation and Analysis with pandas
- Technical requirements
- Introducing pandas Series, pandas DataFrames, and pandas Indexes
-
Learning essential pandas.DataFrame operations
- Indexing, selection, and filtering of DataFrames
- Dropping rows and columns from a DataFrame
- Sorting values and ranking the values' order within a DataFrame
- Arithmetic operations on DataFrames
- Merging and combining multiple DataFrames into a single DataFrame
- Hierarchical indexing
- Grouping operations in DataFrames
- Transforming values in DataFrames' axis indices
- Handling missing data in DataFrames
- The transformation of DataFrames with functions and mappings
- Discretization/bucketing of DataFrame values
- Permuting and sampling DataFrame values to generate new DataFrames
- Exploring file operations with pandas.DataFrames
- Summary
- Chapter 5: Data Visualization Using Matplotlib
- Chapter 6: Statistical Estimation, Inference, and Prediction
- Section 3: Algorithmic Trading in Python
- Chapter 7: Financial Market Data Access in Python
-
Chapter 8: Introduction to Zipline and PyFolio
- Technical requirements
- Introduction to Zipline and PyFolio
- Installing Zipline and PyFolio
- Importing market data into a Zipline/PyFolio backtesting system
- Structuring Zipline/PyFolio backtesting modules
- Reviewing the key Zipline API reference
- Running Zipline backtesting from the command line
- Introduction to risk management with PyFolio
- Summary
- Chapter 9: Fundamental Algorithmic Trading Strategies
- Appendix A: How to Setup a Python Environment
- Other Books You May Enjoy
Product information
- Title: Hands-On Financial Trading with Python
- Author(s):
- Release date: April 2021
- Publisher(s): Packt Publishing
- ISBN: 9781838982881
You might also like
book
Machine Learning for Financial Risk Management with Python
Financial risk management is quickly evolving with the help of artificial intelligence. With this practical book, …
book
Algorithmic Short Selling with Python
Leverage Python source code to revolutionize your short selling strategy and to consistently make profits in …
video
Machine Learning for Algorithmic Trading Bots with Python
Introducing the study of machine learning and algorithmic trading for financial practitioner About This Video Building …
video
Data Analytics of Stock Price Movements with Python: Statistical Techniques in Python Applied to Security Analysis
This brief course will introduce you to data APIs and third-party Python libraries. It provides hands-on …