How to Calculate Mutual Fund Percent Change Using Python yfinance?

20 Replies, 1464 Views

Hey! So I’ve used python yfinance for mutual fund percent change before, and it’s pretty straightforward. You can use the `.history()` method to pull the data, and then calculate the percent change manually.

For example:
```python
import yfinance as yf
data = yf.Ticker("MUTFUND_TICKER").history(period="1y")
data['Pct_Change'] = data['Close'].pct_change() * 100
```
Mutual funds work similarly to stocks in yfinance, so you’re good there. Just make sure the ticker is correct!

Messages In This Thread



Users browsing this thread: 1 Guest(s)