Design a site like this with WordPress.com
Get started

You are your own worst enemy

It’s easy to blame others.

It’s hard to blame yourself.

It’s easy to blame things out of your control.

It’s hard to blame those things that are within your control.

Rules can help you make better decisions. Your goal should be to follow your rules. Not making money. Making money should be a product of following your rules.

Don’t think of yourself as a gamblin’ man. Think of yourself as a risk manager.

Make smarter bets through time. Don’t trade too big in any one position or in any one day. When you place your bets is just as important as where you place your bets.

Advertisement

How to download S&P 500 data from Yahoo Finance using Python

Make sure you have the yfinance package installed first. If you don’t, you can run the following command in your Jupyter notebook:

!pip install yfinance

Input:

import pandas as pd
import numpy as np
import yfinance as yf

Input:

spy_ohlc_df = yf.download('SPY', start='1993-02-01', end='2019-12-01')

Output:

[*********************100%***********************]  1 of 1 downloaded

Input:

spy_ohlc_df.head()

Output:

spy 12-1-19

Conclusion

This is a very brief summary of how you can download stock data information for the S&P 500 from Yahoo Finance, using the Python programming language. If there is something you want to learn about, please let me know in the comments below and I can cover it in a future blog post.