Algorithmic Short Selling with Python: Refine your algorithmic trading edge, consistently generate investment ideas, and build a robust long/short product

Algorithmic Short Selling with Python: Refine your algorithmic trading edge, consistently generate investment ideas, and build a robust long/short product

Leverage Python source code to revolutionize your short selling strategy and to consistently make profits in bull, bear, and sideways markets

Key Features

  • Understand techniques such as trend following, mean reversion, position sizing, and risk management in a short-selling context
  • Implement Python source code to explore and develop your own investment strategy
  • Test your trading strategies to limit risk and increase profits

Book Description

If you are in the long/short business, learning how to sell short is not a choice. Short selling is the key to raising assets under management. This book will help you demystify and hone the short selling craft, providing Python source code to construct a robust long/short portfolio. It discusses fundamental and advanced trading concepts from the perspective of a veteran short seller.

This book will take you on a journey from an idea (“buy bullish stocks, sell bearish ones”) to becoming part of the elite club of long/short hedge fund algorithmic traders. You’ll explore key concepts such as trading psychology, trading edge, regime definition, signal processing, position sizing, risk management, and asset allocation, one obstacle at a time. Along the way, you’ll will discover simple methods to consistently generate investment ideas, and consider variables that impact returns, volatility, and overall attractiveness of returns.

By the end of this book, you’ll not only become familiar with some of the most sophisticated concepts in capital markets, but also have Python source code to construct a long/short product that investors are bound to find attractive.

What you will learn

  • Develop the mindset required to win the infinite, complex, random game called the stock market
  • Demystify short selling in order to generate alpa in bull, bear, and sideways markets
  • Generate ideas consistently on both sides of the portfolio
  • Implement Python source code to engineer a statistically robust trading edge
  • Develop superior risk management habits
  • Build a long/short product that investors will find appealing

Who this book is for

This is a book by a practitioner for practitioners. It is designed to benefit a wide range of people, including long/short market participants, quantitative participants, proprietary traders, commodity trading advisors, retail investors (pro retailers, students, and retail quants), and long-only investors.

At least 2 years of active trading experience, intermediate-level experience of the Python programming language, and basic mathematical literacy (basic statistics and algebra) are expected.

What this book covers

Part I, The Inner Game: Demystifying Short Selling

Chapter 1, The Stock Market Game, discusses a few questions: “Is the stock market an art or a science? What if it was just a game? How do you win an infinite complex random game?” This chapters sets the context of the rest of the book.

Chapter 2, 10 Classic Myths About Short Selling, dispels enduring myths about short selling. The most important question is: “do you want to retire on numbers or stories?” If the former, then short sellers are your pension’s best friend.

Chapter 3, Take a Walk on the Wild Short Side, explains the arc of the long side mindset on the short side and its predictable failure. This chapter describes the three endemic challenges of the short side: market dynamics, scarcity mentality, and information asymmetry.

Part II, The Outer Game: Developing a Robust Trading Edge

Chapter 4, Long/Short Methodologies: Absolute and Relative, addresses idea generation. You will be able to consistently generate as many if not more ideas on the short side than on the long side.

Chapter 5, Regime Definition, explains several regime definition methodologies to reclassify stocks as bullish, bearish, or inconclusive.

Chapter 6, The Trading Edge is a Number, and Here is the Formula, aims to demystify the mythical, mystical, magical trading edge. Regardless of the asset class and timeframes, there are only two strategies. We explain the pros and cons of each one.

Chapter 7, Improve Your Trading Edge, outlines seven ways to improve the distribution of returns and build a robust trading edge.

Chapter 8, Position Sizing: Money is Made in the Money Management Module, proves that money is made in the money management module. We introduce a game changing approach to equity curve trading.

Chapter 9, Risk is a Number, introduces four risk metrics that unapologetically measure robustness. Short sellers are exceptional risk managers.

Part III, The Long/Short Game: Building a Long/Short Product

Chapter 10, Refining the Investment Universe, explains some common pitfalls to avoid, and investors’ desires to address, in order to help distill a large population of stocks into an investable universe. This chapter paves the way to the final part of the book.

Chapter 11, The Long/Short Toolbox, dives into the four most important levers to manage a long/short portfolio. Now that we know what clients want, we look at the tools available to achieve those objectives.

Chapter 12, Signals and Execution, brings together concepts covered in previous chapters, and goes through signal processing, execution, and other vital components when constructing a long/short investment product.

Chapter 13, Portfolio Management System, looks at one of the most underrated tools in your arsenal. Now that you have added a relative short book, whatever tools you have been using so far are in dire need of a radical upgrade. This chapter goes over topics which will help when designing your own Portfolio Management System.

Appendix, Stock Screening, provides a stock screener tool that will address idea generation, the most pressing issue for market participants, and allow you to put everything you have learned into practice.

To get the most out of this book

Sometimes we win, sometimes we learn. The best disposition to get the maximum out of this book is to have lost money on the markets. This will put you in an open state of mind!

Intermediate knowledge of Python, specifically the use of numpy, pandas, and matplotlib will suffice. We will also use some non-standard Python libraries; yfinance and scipy. High school level competence in algebra and statistics is also necessary.

Download the example code files

The code bundle for the book is also hosted on GitHub at We also have other code bundles from our rich catalog of books and videos available at Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here:

More about the authors

Laurent Bernut, Laurent Bernut has 2 decades of experience in alternative investment space. After the US CPA, he compiled financial statements in Japanese and English for a Tokyo Stock Exchange-listed corporation. After serving as an analyst in two Tokyo-based hedge funds, he joined Fidelity Investments Japan as a dedicated quantitative short-seller. Laurent has built numerous portfolio management systems and developed several quantitative models across various platforms. He currently writes and runs algorithmic strategies and is an undisputed authority on short selling on Quora, where he was nominated top writer for 2017, 2018, and 2019.

Michael Covel,

All content is for demonstration purposes, we do not store files, please purchase the printed version of the magazine after reading.

There are many ads here. Please keep in mind that is 100% free. Ads are keeping this site alive. If you use, please make an exception and disable any ads blocking system.

Extraction code:(4sg7)