Machine Learning for Algorithmic Trading
Second Edition
Predictive models to extract signals from market and alternative data for systematic trading strategies with Python
Stefan Jansen
BIRMINGHAM - MUMBAI
Machine Learning for Algorithmic Trading
Second Edition
Copyright 2020 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Producer: Tushar Gupta
Acquisition Editor Peer Reviews: Suresh Jain
Content Development Editor: Chris Nelson
Technical Editor: Aniket Shetty
Project Editor: Carol Lewis
Copy Editor: Safis Editing
Proofreader: Safis Editing
Indexer: Priyanka Dhadke
Presentation Designer: Pranit Padwal
First published: December 2018
Second edition: July 2020
Production reference: 1300720
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-83921-771-5
www.packt.com
packt.com
Subscribe to our online digital library for full access to over 7,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
- Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
- Learn better with Skill Plans built especially for you
- Get a free eBook or video every month
- Fully searchable for easy access to vital information
- Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at for more details.
At www.Packt.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the author
Stefan Jansen is the founder and CEO of Applied AI. He advises Fortune 500 companies, investment firms, and start-ups across industries on data and AI strategy, building data science teams, and developing end-to-end machine learning solutions for a broad range of business problems.
Before his current venture, he was a partner and managing director at an international investment firm, where he built the predictive analytics and investment research practice. He was also a senior executive at a global fintech company with operations in 15 markets, advised central banks in emerging markets, and consulted for the World Bank.
He holds master's degrees in computer science from Georgia Tech and in economics from Harvard and Free University Berlin, and a CFA charter. He has worked in six languages across Europe, Asia, and the Americas and taught data science at DataCamp and General Assembly.
This thorough revision of the first edition was only possible with the collaboration and support of my family, friends, and colleagues. I want to thank the team at Packt for responding to reader feedback and taking the project from start to finish. Chris Nelson was a thorough editor and provided constructive advice. I want to thank my clients for the opportunity to do such exciting work that often offered valuable inspiration for this book.
Most important, however, has been the unrelenting patience and support of Mariana. To her and Bastian, who make it all worthwhile, I dedicate this book.
About the reviewers
Prem Jebaseelan has about 20 years of experience in handling different financial data and enjoys the challenge of organizing, storing, retrieving, and analyzing large volumes of data. Prem has designed and implemented several enterprise-level solutions for front office trading strategies, middle office, and back office applications for funds, and has good experience in applying machine learning and AI-based solutions. Prem has an engineering degree.
Prem is currently the co-founder and CEO of Zentropy Technologies, a fintech company that specializes in creating machine learning based solutions in the financial domain. Prior to this, Prem worked in one of the leading hedge funds as a technology solutions provider.
I would like to thank all my previous employers who have helped me in developing real-world solutions that bring technology and finance together. I would specifically like to thank Dr Yves Hilpisch for our work together in the application of machine learning to real-world trading strategies.
Ramanathan Ramakrishnamoorthy is one of the co founders and directors at Zentropy Technologies. Ramanathan started his professional career with a leading hedge fund and in his latest position, he worked as a project manager responsible for building tools and technologies required by the middle and back office. At Zentropy, Ramanathan is primarily responsible for better understanding project requirements and converting them to technical specs. alongside executing them. Having a keen eye for subtle data patterns, Ramanathan also has a good understanding of the machine learning and data science domain, particularly with expertise in the time series analysis domain. Ramanathan's experience has primarily been around building trading systems, quant warehouses, and backtesting engines for capital markets.
Ramanathan is also an active core group member in the Hyderabad Python group. He leads some of the most important activities of the community, like organizing conferences, monthly meetups, and conducting Python sessions at colleges.
Preface
If you are reading this, you are probably aware that machine learning (ML) has become a strategic capability in many industries, including the investment industry. The explosion of digital data closely related to the rise of ML is having a particularly powerful impact on investing, which already has a long history of using sophisticated models to process information. These trends are enabling novel approaches to quantitative investment and are boosting the demand for the application of data science to both discretionary and algorithmic trading strategies.