The MUST know FIRST step in any quant strategy (Python)

Eric Chen, CFA, FRM
3 min readMay 5, 2023
Photo by Long Phan on Unsplash

Been doing a lot of reading of quant investment/trading strategies, and it has become one of my chewiest beef when someone still uses a static price sheet downloaded from Yahoo (the website) to feed into their model.

So this article is dedicated to the very first step in any quant strategies — get the ticker data to get your balls rolling! And thank you to the god-sent who developed the yahoo finance package.

1. The well-known yfinance package

This is the most commonly used package to get the ticker data with everything consistent with the webpage.

import pandas as pd
import numpy as np
# import the core package
import yfinance as yf

# set the time period of which you want to retrieve the ticker data
PeriodStart = "2015-01-01"
PeriodEnd = "2022-12-24"
# put your tickers in a list
tickerlist = ["AAL", "UAL", "DAL"]

# I'm only taking the adjusted close price here which has been adjusted to any stock splits/dividends, etc.
df = yf.download(tickerlist, start = PeriodStart, end = PeriodEnd)['Adj Close']
df.head()
adjusted close price for the selected tickers

--

--