Wwwimport pandas as pd
import matplotlib.pyplot as plt
# Gantilah data_prices dengan data harga forex yang Anda miliki
data_prices = pd.read_csv(
data_prices = pd.read_csv
'path_to_your_forex_data.csv')
# Menggunakan Moving Average sebagai contoh
data_prices = data_prices .rolling(window=50).mean()
# Mencari pola head and shoulders
# Anda perlu menyesuaikan kondisi sesuai dengan aturan analisis teknikal
head_and_shoulders_pattern = (data_prices > data_prices ) & \
(data_prices .shift(-2) > data_prices .shift(-1)) & \
(data_prices .shift(-1) < data_prices )
# Menampilkan grafik
plt.figure(figsize=(10, 6))
plt.plot(data_prices , label='Close Price', alpha=0.5)
plt.plot(data_prices , label='MA50', linestyle='--', alpha=0.5)
plt.scatter(data_prices.index , data_prices , marker='^', color='g', label='Head and Shoulders Pattern')
plt.legend()
plt.show()