Reader small image

You're reading from  Algorithmic Short Selling with Python

Product typeBook
Published inSep 2021
PublisherPackt
ISBN-139781801815192
Edition1st Edition
Right arrow
Author (1)
Laurent Bernut
Laurent Bernut
author image
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.
Read more about Laurent Bernut

Right arrow

Long/Short 2.0: the relative weakness method

"Truth is by nature self-evident. As soon as you remove the cobwebs of ignorance that surround it, it shines clear."

– Mahatma Gandhi

Indices such as S&P 500, Nasdaq 100, FTSE 100, and Topix are the market capitalization weighted average of their constituents. Roughly half the stocks will do better and the rest worse than the index over any timeframe. There are many more stocks to pick from the large contingent of relative underperformers than the few and far between stocks that drop in absolute value.

Below is the source code to calculate relative series:

def relative(df,_o,_h,_l,_c, bm_df, bm_col, ccy_df, ccy_col, dgt, start, end,rebase=True):
    '''
    df: df
    bm_df, bm_col: df benchmark dataframe & column name
    ccy_df,ccy_col: currency dataframe & column name
    dgt: rounding decimal
    start/end: string or offset
    rebase: boolean rebase to...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Algorithmic Short Selling with Python
Published in: Sep 2021Publisher: PacktISBN-13: 9781801815192

Author (1)

author image
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.
Read more about Laurent Bernut