[Python]Moving Average & Disparity - 2. 시각화
yfinance를 이용하여 최근 1년 간 애플 주가 종가 데이터를 불러오자. import yfinance as yf # yfinance version: 0.1.63 import matplotlib.pyplot as plt # aapl close price for recent 3 months aapl = yf.Ticker('aapl') close_aapl = aapl.history(period='1y', interval='1d').Close 1. 단순 이동평균 생성 및 시각화 # 1. Simple Moving Average; SMA # 1-1. sma5 = close_aapl.rolling(window=5, min_periods=None, win_type=None).mean() sma20 = close_a..
2021.08.26