Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
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

Define functions

As follows are are functions that have been used throughout this book. You can find the full versions on the GitHub. Functions will generally be preceded with their chapter of appearance. The screening will feature both absolute and relative series, so we need the relative function. This will be followed by the classic regime definition functions:

# CHAPTER 5: Regime Definition 
### RELATIVE
def relative(df,_o,_h,_l,_c, bm_df, bm_col, ccy_df, ccy_col, dgt, start, end,rebase=True):
    #### removed for brevity: check GitHub repo for full code ####
### RELATIVE ###
def lower_upper_OHLC(df,relative = False):
    if relative==True:
        rel = 'r'
    else:
        rel= ''      
    if 'Open' in df.columns:
        ohlc = [rel+'Open',rel+'High',rel+'Low',rel+'Close']       
    elif 'open' in df.columns:
        ohlc = [rel+'open',rel+'high',rel+'low&apos...
lock icon The rest of the chapter is locked
arrow left Previous Chapter
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}