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['FastMA'] = df['Close'].rolling(window=12).mean()
df['SlowMA'] = df['Close'].rolling(window=26).mean()

# MACD ve Sinyal hattını hesaplama
df['MACD'] = df['FastMA'] - df['SlowMA']
df['Signal'] = df['MACD'].rolling(window=9).mean()

# Grafik çizme
plt.figure(figsize=(12,5))
plt.plot(df['Close'], label='Kapanış Fiyatı')
plt.plot(df['FastMA'], label='Hızlı MA')
plt.plot(df['SlowMA'], label='Yavaş MA')
plt.plot(df['MACD'], label='MACD', color='red')
plt.plot(df['Signal'], label='Sinyal Hattı', color='green')
plt.legend(loc='upper left')
plt.show()
Chart PatternsFundamental AnalysisTechnical Indicators

Feragatname