This notebook contains the daily returns of the S&P500 sectors, VIX, 10-year Treasury Yield, 30-year Treasury Yield, and Crude Oil.
import yfinance as yf
import pandas as pd
import numpy as np
from wallstreet import get_moving_avg, get_dow_list, get_ytd_return, get_ytd_growth_percentage, get_spdr_sectors, get_daily_returns
from datetime import datetime
datetime.now()
datetime.datetime(2024, 3, 28, 17, 23, 6, 557839)
pd.options.display.float_format = '{:.2f}%'.format
my_list = get_spdr_sectors()
my_list.append('CL=F')
my_list.append('^TNX')
my_list.append('^TYX')
my_list.append('^VIX')
my_list.append('VOOG')
my_list.append('VOOV')
pd.options.display.float_format = '{:.2f}'.format
t = get_daily_returns(my_list)
t = t.sort_values(by='percent change',ascending=False)
t.set_index('ticker')
name | previous_close | current_price | percent change | today_volume | previous_volume | |
---|---|---|---|---|---|---|
ticker | ||||||
CL=F | 81.35 | 83.11 | 2.16 | 0.27 | 0.24 | |
^VIX | 12.78 | 13.01 | 1.80 | 0.00 | 0.00 | |
XLE | 93.40 | 94.41 | 1.08 | 17.18 | 16.98 | |
XLU | 65.20 | 65.65 | 0.69 | 13.75 | 17.30 | |
XLRE | 39.28 | 39.53 | 0.64 | 5.70 | 6.71 | |
XLF | 41.89 | 42.12 | 0.55 | 39.73 | 36.67 | |
VOOV | 179.90 | 180.47 | 0.32 | 0.13 | 0.08 | |
XLB | 92.64 | 92.89 | 0.27 | 4.43 | 4.22 | |
^TNX | 4.20 | 4.21 | 0.24 | 0.00 | 0.00 | |
XLP | 76.26 | 76.36 | 0.13 | 9.11 | 9.85 | |
XLI | 125.94 | 125.96 | 0.02 | 7.29 | 7.16 | |
XLV | 147.71 | 147.73 | 0.01 | 7.67 | 8.80 | |
XLC | 81.79 | 81.66 | -0.16 | 5.29 | 4.18 | |
XLK | 208.72 | 208.27 | -0.22 | 4.35 | 6.25 | |
VOOG | 305.41 | 304.71 | -0.23 | 0.11 | 0.12 | |
^TYX | 4.36 | 4.35 | -0.23 | 0.00 | 0.00 | |
XLY | 184.46 | 183.89 | -0.31 | 2.98 | 2.91 |
spy_sectors = t[t['ticker'].str.startswith('X')]
spy_sectors.set_index('ticker')
name | previous_close | current_price | percent change | today_volume | previous_volume | |
---|---|---|---|---|---|---|
ticker | ||||||
XLE | 93.40 | 94.41 | 1.08 | 17.18 | 16.98 | |
XLU | 65.20 | 65.65 | 0.69 | 13.75 | 17.30 | |
XLRE | 39.28 | 39.53 | 0.64 | 5.70 | 6.71 | |
XLF | 41.89 | 42.12 | 0.55 | 39.73 | 36.67 | |
XLB | 92.64 | 92.89 | 0.27 | 4.43 | 4.22 | |
XLP | 76.26 | 76.36 | 0.13 | 9.11 | 9.85 | |
XLI | 125.94 | 125.96 | 0.02 | 7.29 | 7.16 | |
XLV | 147.71 | 147.73 | 0.01 | 7.67 | 8.80 | |
XLC | 81.79 | 81.66 | -0.16 | 5.29 | 4.18 | |
XLK | 208.72 | 208.27 | -0.22 | 4.35 | 6.25 | |
XLY | 184.46 | 183.89 | -0.31 | 2.98 | 2.91 |
Disclaimer: I am not a professional investment adviser and my opinions are based on my own technical analysis. Please consult an investment professional before making investment decisions.