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, 4, 25, 17, 23, 7, 341663)
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 | 82.81 | 83.83 | 1.23 | 0.00 | 0.36 | |
^TNX | 4.65 | 4.71 | 1.16 | 0.00 | 0.00 | |
^TYX | 4.78 | 4.82 | 0.75 | 0.00 | 0.00 | |
XLB | 88.34 | 88.97 | 0.71 | 4.59 | 4.78 | |
XLE | 96.19 | 96.63 | 0.46 | 13.18 | 10.65 | |
XLI | 122.09 | 122.46 | 0.30 | 10.32 | 11.06 | |
XLU | 66.74 | 66.92 | 0.27 | 15.78 | 13.06 | |
XLY | 174.19 | 174.34 | 0.09 | 5.34 | 4.47 | |
XLK | 198.03 | 197.60 | -0.22 | 5.67 | 4.58 | |
XLP | 75.93 | 75.75 | -0.24 | 14.35 | 15.01 | |
VOOV | 174.99 | 174.42 | -0.33 | 0.07 | 0.07 | |
VOOG | 293.65 | 292.51 | -0.39 | 0.12 | 0.13 | |
XLRE | 36.64 | 36.43 | -0.57 | 8.37 | 10.76 | |
XLF | 41.12 | 40.88 | -0.58 | 49.68 | 33.96 | |
XLV | 140.86 | 139.92 | -0.67 | 9.67 | 7.38 | |
XLC | 80.84 | 77.96 | -3.56 | 14.32 | 6.20 | |
^VIX | 15.97 | 15.37 | -3.76 | 0.00 | 0.00 |
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 | ||||||
XLB | 88.34 | 88.97 | 0.71 | 4.59 | 4.78 | |
XLE | 96.19 | 96.63 | 0.46 | 13.18 | 10.65 | |
XLI | 122.09 | 122.46 | 0.30 | 10.32 | 11.06 | |
XLU | 66.74 | 66.92 | 0.27 | 15.78 | 13.06 | |
XLY | 174.19 | 174.34 | 0.09 | 5.34 | 4.47 | |
XLK | 198.03 | 197.60 | -0.22 | 5.67 | 4.58 | |
XLP | 75.93 | 75.75 | -0.24 | 14.35 | 15.01 | |
XLRE | 36.64 | 36.43 | -0.57 | 8.37 | 10.76 | |
XLF | 41.12 | 40.88 | -0.58 | 49.68 | 33.96 | |
XLV | 140.86 | 139.92 | -0.67 | 9.67 | 7.38 | |
XLC | 80.84 | 77.96 | -3.56 | 14.32 | 6.20 |
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.