December 25, 2023

Long Short Equity ETF Performance

Portfolio Combinations

Hedging in the stock market is a strategy used by investors to reduce the risk of adverse price movements in their investments.
It involves taking a position or using financial instruments to offset the potential losses in another investment.
some common hedging techniques in the stock market involve using Exchange-Traded Funds (ETFs).
ETFs provide a way to diversify a portfolio by investing in a basket of stocks or other assets.
They can be used to hedge against the poor performance of individual stocks or sectors (or the entire market).
It’s important to note that while hedging can help manage risk, it also comes with costs and complexities.
The effectiveness of hedging strategies depends on various factors, including market conditions, the specific instruments used, and the investor’s goals and risk tolerance.

This post tries to hedge by using the “SH” ETF to hedge against market downturns.
The “SH” (ProShares Short S&P 500) ETF aims to provide investors with inverse exposure to the daily performance of the S&P 500 Index.
In other words, it seeks to deliver returns that are -1x the daily performance of the S&P 500.

The whole market is represented by another ETF, “SPY”, It is one of the most widely traded exchange-traded funds (ETFs) and is designed to track the performance of the S&P 500 Index.

We will use the portfolio construction service offered by our API service (Alphaoverbeta’s API website), to build and backtest multiple portfolio combinations and verify the effectiveness of adding SH to a market portfolio.

The Simple Python code is here:

# create the portfolio manager to manage the portfolio we backtest
portfolio_api = PortfolioManager(key='DEMO', secret='DEMO')

# initial portfolio size in $ terms is $20K
portfolio_size = 20000

# iterate over all portfolio combinations of SH and SPY
for equity_size_p in arange(0.1,1,0.1):
    # calculate the cost to buy SH and SPY
    equity_cost = equity_size_p * portfolio_size
    sh_cost = portfolio_size - equity_cost
    # create a portfolio and connect to it

    # add symbols to the portfolio
    portfolio_api.add_cost(symbol='SPY', cost=equity_cost)
    portfolio_api.add_cost(symbol='SH', cost=sh_cost)

    # run a backtest on the symbols added before with the requested period and the requested time interval
    bt_df, status_code = portfolio_api.backtest(period='3y', interval='1d')
    perf_df['SPY {:.1f}%, SH {:.1f}%'.format(100.*equity_size_p, 100.*(1-equity_size_p))] = bt_df['equity'] / bt_df['equity'].iloc[0]

Here the portfolio combination is tested using the backtest offered by AlphaOverBeta’s financial service to provide the results.

Portfolio Combinations

First, we see that SPY below 60% of the portfolio is losing, the market must be present above 60% to show profits, especially when no conditions are introduced on entry and exit and the typical behavior is more a buy-and-hold than timing.

The 80% SPY, 20% SH portfolio is very interesting as far as volatility goes, it is a very low vol. portfolio with minimal drawdown and is used as the reference portfolio, above that (90% SPY), the market has the dominant tone.

It’s important to note that while a 80% SPY, 20% SH portfolio is a well-balanced strategy, there is no one-size-fits-all approach to asset allocation.
Individual circumstances, risk tolerance, and investment goals vary, and investors should consider them to tailor their portfolios to their specific needs. Additionally, market conditions and investment products can change, so it’s advisable to stay informed and periodically review the portfolio strategy.

The above example was developed using the financial API service offered by AlphaOverBeta, where you may observe the benefits of such a financial service to apps requesting complex financial procedures.

Trade Smart,