import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pandas_datareader import data as web

# Finansal veriyi çekme
df = web.DataReader('AAPL', data_source='yahoo', start='2020-01-01', end='2020-12-31')

# Hızlı ve yavaş hareketli ortalamaları hesaplama
df = df.rolling(window=12).mean()
df = df.rolling(window=26).mean()

# MACD ve Sinyal hattını hesaplama
df = df - df
df = df.rolling(window=9).mean()

# Grafik çizme
plt.figure(figsize=(12,5))
plt.plot(df, label='Kapanış Fiyatı')
plt.plot(df, label='Hızlı MA')
plt.plot(df, label='Yavaş MA')
plt.plot(df, label='MACD', color='red')
plt.plot(df, label='Sinyal Hattı', color='green')
plt.legend(loc='upper left')
plt.show()
면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.