Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Algorithmic Short Selling with Python
Algorithmic Short Selling with Python

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

eBook
$38.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Algorithmic Short Selling with Python

10 Classic Myths About Short Selling

Since the 1975 movie Jaws, whenever we get in the water, we all have this instinctive apprehension about what swims beneath. Sharks are unparalleled killing machines. They have a better detection system than the most technologically advanced sonar. They swim faster than speed boats. They have three rows of razor-sharp teeth that continuously regrow. Yet, did you know that deep in the comfort of your home, somewhere in the dark, there is something a thousand times deadlier than any great white? There are, on average, 80 shark attacks every year, mostly exploratory bites and mistaken identity. Meanwhile, falling out of bed carries a far greater probability. Sharks are majestic creatures. If they wanted us dead, we would be. Apparently, they don't like junk food.

Short sellers are like sharks, a little less majestic, but still vastly misunderstood and not as deadly as you might think. You know you have a bit of a reputational issue when your brethren, in allegedly the most reviled industry, would still gladly sharpen pitchforks at the single mention of your profession. In this chapter, we will debunk 10 of the most enduring myths surrounding short selling:

  • Myth #1: Short sellers destroy pensions
  • Myth #2: Short sellers destroy companies
  • Myth #3: Short sellers destroy value
  • Myth #4: Short sellers are evil speculators
  • Myth #5: Short selling has unlimited loss potential but limited profit potential
  • Myth #6: Short selling increases risk
  • Myth #7: Short selling increases market volatility
  • Myth #8: Short selling collapses share prices
  • Myth #9: Short selling is unnecessary during bull markets
  • Myth #10: The myth of the "structural short"

Myth #1: Short sellers destroy pensions

"Do you believe in God, Monsieur Le Chiffre?"

"I believe in a reasonable rate of return."

– James Bond, Casino Royale

During the Great Financial Crisis (GFC) of 2008, many influential figures encouraged market participants to buy stocks to "shore up the market." They claimed it was "the patriotic thing to do." I grew up in an era when patriots were altruistic individuals who put their lives at risk so that others may have a better future. Somewhere along Wall Street, a patriot became someone who put other people's money at risk in order to guarantee an end-of-year bonus and ego massage.

In the GFC, short sellers did not decimate anyone's pension for a simple reason: pension funds did not allocate to short sellers. Neither did they cause the GFC. Short sellers did not securitize toxic debt or cause the real estate market bubble, nor were they responsible for its collapse. Their crime was to do their homework, take the other side, and profit from the debacle.

Traders make one of two things. Either they make money, or they make excuses. When they make money, performance does the talking. When they don't, they scramble for excuses. Short sellers are the perfect scapegoats. The most vitriolic critics of short sellers are not exactly fund management nobility.

Besides, it might be counter-productive in the long term to blame short sellers for one's misfortunes. There are only two ways you can live your life: as a hero or as a victim. A hero takes responsibility, lives up to the challenges, and triumphs over adversity. A victim will blame others for their failures. The "patriots" who blame short sellers choose the path of the victim. Next time asset allocators decide on their allocation, who do you think they would rather allocate to: heroes or victims?

Now, do short sellers really decimate pensions? The single most important question about your own pension is: "do I want to retire on stories, or do I want to retire on numbers?" The day after your retirement, what will matter to you: all those buzz investment themes or the balance in your bank account?

If you think they are one and the same, then keep churning, and wait for either the handshake and the gold watch, or the tap on the shoulder from the line manager for a life-altering conversation. If you choose to retire on numbers, however, then let's have a look at them.

Nothing illustrates the "story versus numbers" dichotomy better than the active versus passive investing debate. Active management refers to fund managers taking bets away from the benchmark, a practice referred to as active money. Passive investing refers to minimizing the tracking error by mimicking the index. Active managers claim their stock-picking ability and portfolio management skills deliver superior returns. However, the numbers tell a different story. According to S&P's Index versus Active reports, the vast majority of active managers underperform the S&P 500 benchmark on 1, 3, and 5 year-horizons. This means that their cumulative compounded returns are lower than the benchmark. Exchange-Traded Funds, or ETFs, fared better than active managers every year on record, even during the most severe market downturns.

A more detailed report regarding active manager performance compared to the benchmarks can be accessed via S&P's SPIVA reports: https://www.spglobal.com/spdji/en/spiva/#/reports/regions.

The proof is in the pudding. The burden of proof is no longer on ETFs but on active managers to prove that they can deliver more than the index. The debate has gradually shifted from "which manager should we allocate to?" to "remind me again why we should be going with an expensive underperforming benchmark hugger when there is a liquid, better, cheaper alternative?"

Unfortunately, there is more. The penalty for deviating from the benchmark is severe. If managers deviate and outperform, they are knighted as "stock pickers." Yet, when they stray and underperform, they are dubbed as having "high tracking errors." This often leads to redemptions, the kiss of death for fund managers. When the choice is between becoming a hero or keeping your job, self-preservation compels active managers to mirror the benchmark, a practice referred to as closet indexing. This is the famous "no-one ever got fired for holding [insert big safe blue-chip stock here…]" line. If active managers end up mirroring their benchmark, then the "active versus passive" debate is a misnomer. It really comes down to a choice between low-cost indexing via an index fund versus expensive closet indexing via a self-preserving active manager. Either way, you get the same index, but with the latter, you also have to pay a middle-man, called an active manager. As John Boggle, founder of Vanguard, used to say: "in investing, you get what you don't pay for."

That does not mean active management should die an unceremonious death. There are exceptional active managers worth every penny of their management fees. It simply means that the average active mutual fund manager gives active management a bad name. Investors who go down the active management route not only take an equity risk premium. They also take an active management risk premium. The current crisis of active management is nothing but the time-honored routine of the middle man in every industry who realizes that they can no longer delay efficiency.

Next, let's look at what happens during bear markets. Markets have returned between 6.3% and 8% on average. Compounded returns over a century are astronomical. So, in theory, you should stay invested for the long run. Explain that again to the cohorts who retired in 2001 and 2009. Markets have gone down 50% twice in a decade. When the response to "too big to fail" and "too much leverage" was to make them bigger, hyper-leverage, and put the same people responsible for the GFC back in the driver's seat, rest assured that markets are bound to hit "soft patches" again. Long-only active managers may display heroic grace under fire during bear markets but, when your net worth has gone down by 50%, a 1 or 2% outperformance is a rounding error. Two double diamond black slopes in a decade and everyone wants bear market insurance: "What should I buy during a bear market?"

Let us reframe the question. Imagine someone walking up to you and asking: "There is a bull market going on. What should I be short selling?" Pause for a second and then consider your reaction. If selling a bull market does not make any sense, then why would you buy anything during a bear market? There is no safe harbor asset class that will magically rise. The only thing that goes up in a bear market is correlation. There will be ample time to buy at bargain-basement prices once the rain of falling knives stops.

During a bear market, the only market participants who can guarantee a reasonable rate of return are those whose mandate is inversely correlated with the index. These people are short sellers. You do not have to like them. You do not even have to stay invested with them during bull markets. More than any other market participants, they understand the cyclicality of inflows and redemptions. If you choose to retire on numbers, then you owe your pension to consider allocating to short sellers.

This brings us to a counter-intuitive conclusion. If you choose to retire on numbers instead of stories, then passive investing is the way to go on the long side. For capital protection and alpha generation during downturns, investors need to allocate to short sellers. In the active management space, the only market participants who will deliver a reasonable rate of return on your pension are short sellers.

Another counter-intuitive conclusion for practitioners is evolution. Active fund managers face an unprecedented existential crisis. If they want to survive, they need to evolve, adapt, and acquire new skills. Short selling might very well be a rare skill uniquely suited to market participants who are determined to stay relevant.

Myth #2: Short sellers destroy companies

"Round up the usual suspects."

– Capitaine Renaud, Casablanca

When the real estate bubble burst in 2007, what were the short sellers in the risk committee and boards of directors at Lehman Brothers doing? Nothing. They did strictly nothing to prevent or remedy the situation because none of them ever sat on any of those committees. In the history of capitalism, no short seller has ever sat on the board of directors of a company whose stock they were selling short.

We can agree that fundamentals drive share prices in the long run. The driving force is the quality of management. Mark Zuckerberg is the genius behind Facebook. Warren Buffett turned an ailing textile company named Berkshire Hathaway into an industrial conglomerate. Jeff Bezos built Amazon. Steve Jobs 2.0 was the architect of Apple's renaissance. If top management is so eager to take credit for success, then it should equally be held responsible for failure. Steve Jobs 1.0 ran Apple into the ground. Kay Whitmore buried Kodak. The responsibility for Bears Stearns, Lehman Brothers, Merrill Lynch, and AIG falls squarely on the shoulders of those at the helm. Short sellers did not make any of the bad decisions that destroyed those companies. Bad management makes bad decisions that lead to bad outcomes, the same way that good management makes good decisions that lead to good results.

No one captured what happens at the highest echelon of companies better than Steve Jobs in his 1995 Lost Interview. He mentioned that "groupthink" amidst the rarefied atmosphere of top management in venerable institutions sometimes leads to a cognitive bias called the Dunning-Kruger effect. As an example, Kodak was once an iconic brand. Management believed they were so ahead of the game they could indefinitely delay innovation. They took a step backward to their old core technology when the world was moving forward. As tragic as it was back then, there is no flower on Kodak's grave today. The world, and even the 50,000 Kodak employees laid off, have moved on. Today, Kodak is a case study in the failure of management to embrace innovation.

Top management love to surround themselves with bozocrats, non-threatening obedient "yes-men," whose sole purpose is to reassure the upper crust of their brilliance, reinforcing a fatal belief in infallibility. Dissent is squashed. Innovation, branded as cannibalization, is swiftly buried in the Kodak sarcophagus of innovation.

Top management becomes so infatuated with their brilliance that they do not even realize they are detached from reality. Given sufficient time, their obsolete products destroy them from the inside. Short sellers simply ride arrogance to its dusty end.

The history of capitalism is the story of evolution. During World War I, the dominant mode of transportation was the horse. On the first day of World War II, the world woke up in horror to a German panzer division mowing down the Polish cavalry. The cruel lesson is that evolution does not take prisoners. Out of the hundreds of car manufacturers between the two world wars emerged a few winners. The rest of the industry went out of business. For every winner, there are countless losers. Today, everyone is perfectly happy with horse-carts running around Central Park, but no one sheds tears over the defunct horse-cart industry. Everyone has forgotten the names of all those small car manufacturers. The world has moved on.

We often see the S&P 500 as this monolithic hall of corporate fame and power, but we forget that since the index was formed in 1957, only 86 of the original 500 constituents are still in the index. The other 414 have either gone bankrupt or been merged into larger companies. Radio Shack did not go out of business because of short sellers. It went out of business because it could not evolve to face the competition of Amazon and the likes of Best Buy. Short sellers do not destroy companies. They escort obsolescence out of the inexorable march of evolution.

Myth #3: Short sellers destroy value

"Price is what you pay, value is what you get."

– Warren Buffett

Market commentators love to put a dollar sign on the destruction of value every time share prices tank. The net worth of Mr Zuckerberg shrank by $12 billion on July 26, 2018. Since short sellers stand to profit from the drop, they are guilty of value destruction by association. For example, George Soros is often associated with the fall of the British pound in 1995. How could one man single-handedly bring down the currency of one of the wealthiest nations on earth? He bet big on the Bank of England's unsustainable stance.

At the heart of this is a confusion between intrinsic and market values. One is value, the other is valuation. Intrinsic value is the net wealth companies create through the sale of products and services. Market value is the price market participants are willing to pay. Market and intrinsic value live in parallel universes that rarely intersect. One is hard work. The other is the fabled Keynesian beauty contest. The bottom line is that shareholders do not create any more value than short sellers destroy any.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • 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

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.

Who is this book 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 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

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 30, 2021
Length: 376 pages
Edition : 1st
Language : English
ISBN-13 : 9781801810395
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Sep 30, 2021
Length: 376 pages
Edition : 1st
Language : English
ISBN-13 : 9781801810395
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $114.97 $128.97 $14.00 saved
Hands-On Financial Trading with Python
$46.99
Algorithmic Short Selling with Python
$54.99
Machine Learning for Algorithmic Trading
$57.99
Total $114.97$128.97 $14.00 saved Stars icon

Table of Contents

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

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.7
(29 Ratings)
5 star 89.7%
4 star 0%
3 star 3.4%
2 star 6.9%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Guy R. Porter Sep 24, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you're trading for your own account or managing portfolios for other investors, the insights in this book are priceless. As a short seller, Bernut's methods shine in market crashes especially. But long only managers have much to learn from what's in this book.As Ken Grant noted in "Trading Risk," every manager needs to make sure at least some part of the portfolio does better when the benchmark sinks. And that's a big part of what is addressed here.About two thirds of the book is NOT about short-selling, but about making any trading system better. Bernut provides a set of rational, step by step methods for developing, deploying, monitoring and improving your best ideas for trading systems.Here are a few highlights:If you ask 10 traders what their edge is, 8 of them will tell you a story instead. Winners and professionals quantify that edge and their strategy (pp 109 - 133)I liked the refreshingly frank talk about what your stops should be and how they should be enforced. Operational Risk (the chance of a manager making a mistake) is the largest risk among individuals and you'll find solid measures here to shore up weaknesses to improve your results quantifiably (pp134-169).If you're still using the "2% risk per trade heuristic," you really need to understand your peril better. Especially true in times of market chaos, position sizing is the link between your financial and your emotional capital. (pp171-202)ABOUT THE PROGRAMMING PART: I have only a passing knowledge of Python, therefore much of the real gold is hidden from me so far. The narrative itself is enough to provide a good guide. However, if you have been moved, as I have, to study and learn to program in order to automate what can be automated, there is even more value here with code supplied through GitHub and color graphics available through the publishers website.
Amazon Verified review Amazon
Daniel Feb 04, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Insightful and enjoyable read. I am Groot.
Amazon Verified review Amazon
Ivan Vasilev Oct 25, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book was clearly written with passion and it shows the author's in-depth knowledge and hands-on experience in the financial field.
Amazon Verified review Amazon
Michal Malík Aug 21, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a book I will be periodically returning to in my trading journey. Reading it I realized that there is more to the market than I had ever thought. My brain also found out new ways to approach the market and a guideline on how to create a trading system and how to grade it. The source code is a great addition. The book gives a general outline of what the code does and the code show details and implementation. They complement each other and make the point clear. Finally, Laurent understands that even with a trading system, we are humans, not machines and gives us tips to better sleep at night.
Amazon Verified review Amazon
Amazon Customer May 16, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I’ve known about Laurent Bernut for a couple years from his Quara posts. I purchased his book day one and have been absorbing the content ever since. I am a young software engineer with no professional trading knowledge, only self taught. I have made significant progress building my own trading system using the ideas in this book. The main value of this book is it teaches the building blocks of creating a successful strategy, while providing a very generous starting point with the code provided.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.