🥋

Accessing Stock Data from YFinance

💡
This is not investment advice, there is no implication of any guarantee. All investment is risky and you should take advice from actual advisors. EDUCATION ONLY.

Definition

Technical Investing

Technical investing is evaluating investments and trading opportunities based on trends and patterns in charts.

Python Code

Download Data for a Stock

import yfinance as yf

def stock_info(ticker):
  stocks = yf.Ticker(ticker)
  hist = stocks.history(period="max")["Close"]
  print(stocks.financials)
  print(hist)
  print(stocks.institutional_holders)
  print(stocks.balance_sheet)
  #print(stocks.cashflow)
  #print(stock.earnings)
stock_info('AAPL')

Yahoo Finance Data into Pandas DataFrame

import yfinance as yf
import pandas as pd


def stock_info(ticker):
  stocks = yf.Ticker(ticker)
  stock_dict = stocks.info
  stock_df = pd.DataFrame(list(stock_dict.items()))
  print(stock_df)

stock_info('AAPL')