How to Get yfinance Python Real-Time Quotes and Percentage Change for Stocks?

18 Replies, 1158 Views

I feel you on the yfinance python real time quotes and percentage change struggle. It’s not perfect, but it’s decent for free. The delay is usually around 15 mins, so if you’re day trading, it might not cut it.

For percentage change, I do this:
```python
import yfinance as yf

data = yf.download("MSFT", period="1d", interval="1m")
data['Pct_Change'] = data['Close'].pct_change() * 100
print(data[['Close', 'Pct_Change']].tail())
```
If you need better real-time data, check out Alpaca. It’s free for paper trading and has pretty good live data.

Messages In This Thread



Users browsing this thread: 1 Guest(s)