Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Algorithmic Short Selling with Python

You're reading from  Algorithmic Short Selling with Python

Product type Book
Published in Sep 2021
Publisher Packt
ISBN-13 9781801815192
Pages 376 pages
Edition 1st Edition
Languages
Author (1):
Laurent Bernut Laurent Bernut
Profile icon Laurent Bernut

Table of Contents (17) Chapters

Preface The Stock Market Game 10 Classic Myths About Short Selling Take a Walk on the Wild Short Side Long/Short Methodologies: Absolute and Relative Regime Definition The Trading Edge is a Number, and Here is the Formula Improve Your Trading Edge Position Sizing: Money is Made in the Money Management Module Risk is a Number Refining the Investment Universe The Long/Short Toolbox Signals and Execution Portfolio Management System Other Books You May Enjoy
Index
Appendix: Stock Screening

Portfolio Management System

"Toto, I have a feeling we are not in Kansas anymore."

– Dorothy, The Wizard of Oz

My first job in the hedge fund world was to build and maintain a Portfolio Management System (PMS) for a start-up hedge fund with less than $5 million under management. The principals believed that risk management was not some ornament of the business, but the business itself. Fast forward to now, and they are the dominant player in the Japanese alternative space. In this chapter, we will continue with our work from the last two chapters, and introduce a customized PMS which shows risk visualization across the portfolio.

To illustrate the importance of a robust PMS, let's connect a few concepts we explored throughout this book. In Chapter 1, The Stock Market Game, we set the context that the market is an infinite, complex random game. In Chapter 6, The Trading Edge is a Number, and Here is the Formula, we unveiled the...

Importing libraries

For this chapter and the rest of the book, we will be working with the pandas, numpy, yfinance, and matplotlib libraries. So, please remember to import them first:

# Import Libraries
import pandas as pd
import numpy as np
import yfinance as yf
%matplotlib inline
import matplotlib.pyplot as plt

Symptoms of poor portfolio management systems

When it comes to turning performance around, a good PMS is the lowest hanging fruit. In 2005, I joined a hedge fund whose PMS was so ugly, looking at it could have caused brain damage. I promptly tooled it up, at least to get rid of the health hazard. Suddenly, problem children lit up like garlands on a Christmas tree. Volatile penny stocks on the short side, lazy dogs, and unappreciated racing hounds were all swiftly dealt with. Volatility came down. Performance was more consistent. The Sharpe ratio jumped. Investors noticed. Assets Under Management (AUM) grew. It was that simple.

Everyone wants to know the "secret sauce" of the winners, but this is one area where the lessons of the "alpha-challenged" ones might help us from inadvertently repeating the same mistakes. Here is a simple exercise that will help you figure out if your system is in need of an upgrade. Deficient PMSes share one or more of the following...

Your portfolio management system is your Iron Man suit

"You know, the question I get asked most often is, "Tony, how do you go to the bathroom in your suit?" [Long pause] Just like that."

– Tony Stark, Iron Man

Tony Stark may be a genius, a billionaire, a playboy, and a philanthropist. What truly gives him his superpower is his custom-made Iron Man suit. He did not buy his suit off the rack at Macy's. He torpedoed a few Lamborghinis in his garage building something that uniquely enhanced his fighting style. In the same way, your PMS is your Iron Man suit. It is an extension of your trading strategy. Its sole purpose is to help you make trading decisions under uncertainty. Since no one trades like you, it requires a high degree of customization.

A classic mistake is to buy an expensive off-the-shelf software package, thinking that more information will lead to better trading decisions. Software solutions are primarily reporting...

Automating the boring stuff

All market participants want to be the next Jim Simmons. No one wants to take care of the plumbing. People want to do the exciting stuff. They want to show up with their billion-dollar idea and trade away. They do not want to take care of risk management. In this section are a few examples of time-consuming and ultimately boring processes that should be automated and the reasons why.

Trade reconciliation is the process of reconciling orders placed with trades executed. It shows what trades went through at what price. This is one of the few tasks that would make reading the tax code look like an exciting endeavor. Yet it is an important task as the data is used to perform trade analysis. Did the price beat the volume at weighted average price (VWAP) or not?

Updating the PMS is boring but not as easy as it seems. Companies go through all sorts of corporate actions, such as dividends and stock splits. Those corporate actions have an impact on the consistency...

Building a robust portfolio management system

Below is a quick step-by-step guide to building a robust PMS. Remember that each PMS requires a high degree of customization. You are building your own Iron Man suit. As a result, this guide will remain fairly vague.

  • Formalize your strategy into simple trading decisions: buy/sell, how much, at what price. A trading sequence is fairly straightforward. Draw a flowchart and fill the sequence.
  • Add decisions that come out of risk management: liquidity, weight, borrow utilization, net beta, and gross and net exposure. We saw earlier a risk reduction across the entire portfolio.
  • From your monitoring tool, create a separate trading sheet with each trading decision in a separate column. This minimalist monitoring tool is particularly efficient for large portfolios.
  • Beyond your field of vision, embed your trading rules. This can be columns in the far right of the sheet, macros on Excel, and scripts on Python. All you...

Summary

Investing in a PMS is the highest return on investment decision you will ever make. Without one, you might get lucky a few times picking the right stocks here and there, but nothing compares to the disciplined consistency of a robust PMS. You will top up winners and deal with flesh wounds before gangrene sets in and limits performance. You will become a more disciplined market participant. Risk management is not part of the business. It is the business. Portfolio managers are not in the business of picking stocks. They are in the business of managing risk with the stocks they either picked or passed. Small benefits compound over time and set you apart from the competition who still run around believing stock picking is the key to success. When your portfolio management becomes your Iron Man suit, you will be competing against people who think they trade a system.

Short selling is risky. The market does not cooperate. Yet choosing not to learn to sell short is riskier....

lock icon The rest of the chapter is locked
You have been reading a chapter from
Algorithmic Short Selling with Python
Published in: Sep 2021 Publisher: Packt ISBN-13: 9781801815192
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}