Yfinance.download() Auto Adjust=True - What does it actually do?

420 Views Asked by At

What does auto_adjust=True do while downloading the historical data of a stock using the yfinance module in Python? I found no official documentation.

algotrading101 says it adjusts all OHLC (Open/High/Low/Close) prices. However, this StackOverflow post says it will only adjust the closing price.

Which one is correct?

2

There are 2 best solutions below

0
esqew On

The code for the yfinance library is available on GitHub. We can inspect auto_adjust in the codebase.

A quick glance at the relevant code linked above shows that auto_adjust makes adjustments to each of the Open, High, and Low prices based on the ratio of Adj Close and Close data provided by the upstream source.

0
Chandani Kapoor On

Usually,

auto_adjust=True

in yfinance automatically adjusts historical stock prices for splits and dividends. This ensures that the price data reflects the true performance of the stock over time.

However, I'm working on a project that involves analyzing historical forex price data.

I came across a helpful and simple blog post that explains how to use the yfinance library in Python to download forex data. It doesn't need "auto_adjust=True" for downloading the data.

Here is where you can find the blog: https://blog.quantinsti.com/download-forex-price-data-yfinance-library-python/

The blog post provides clear instructions on:

  1. Installing the yfinance library
  2. Downloading daily and minute-frequency forex data
  3. Plotting the downloaded data as a time series

I followed the steps in the blog post and successfully downloaded the data I needed.