The BofA Merrill Lynch US High Yield Master II Option-Adjusted Spread (OAS) can be correlated to the S&P 500 (SPX) or SPDR S&P 500 ETF (SPY), as it serves as a measure of credit risk in the market, and changes in credit risk often impact equity markets.
How the Correlation Works:
- High Yield Spread (OAS) represents the risk premium investors demand to hold high-yield corporate bonds (junk bonds) over risk-free government bonds. When the spread widens, it suggests rising credit risk or fear of default, indicating financial stress in the economy.
- Stock Market Impact (SPY/SPX): A widening spread typically signals market concerns about the health of corporations, which often leads to falling stock prices, particularly in economically sensitive sectors. Conversely, a narrowing spread indicates investor confidence in corporate credit and is often associated with rising stock prices.
- Widening Credit Spread (OAS increases):
- Narrowing Credit Spread (OAS decreases):
- Historical data shows that during periods of economic stress, such as the 2008 financial crisis or the COVID-19 pandemic in 2020, the OAS spread widened, and stock markets (SPX/SPY) simultaneously declined.
Correlations of the SPY 100 300 400 500 600 can also help pick stock sectors on the move accordingly.
Code:
declare lower;
# Calculate mean and standard deviation
def spx_mean = Average(close(symbol = "SPX"), 50);
def spx_stddev = StDev(close(symbol = "SPX"), 50);
def hyg_mean = Average(close(symbol = "HYG"), 50);
def hyg_stddev = StDev(close(symbol = "HYG"), 50);
# Normalize using Z-score transformation
def spx_standardized = (close(symbol = "SPX") - spx_mean) / spx_stddev;
def hyg_standardized = (close(symbol = "HYG") - hyg_mean) / hyg_stddev;
plot SPX_Close = spx_standardized;
SPX_Close.SetDefaultColor(Color.CYAN);
SPX_Close.SetLineWeight(2);
SPX_Close.SetPaintingStrategy(PaintingStrategy.LINE);
plot HYG_Close = hyg_standardized;
HYG_Close.SetDefaultColor(Color.RED);
HYG_Close.SetLineWeight(2);
HYG_Close.SetPaintingStrategy(PaintingStrategy.LINE);
# Add correlation plot
def correlationLength = 20;
plot Correlation = correlation(spx_standardized, hyg_standardized, correlationLength);
Correlation.SetDefaultColor(Color.YELLOW);
Correlation.SetLineWeight(1);
Correlation.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Last edited by a moderator: