import 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
'MA50'] = data_prices['Close'].rolling(window=50).mean()

# Mencari pola head and shoulders
# Anda perlu menyesuaikan kondisi sesuai dengan aturan analisis teknikal
head_and_shoulders_pattern = (data_prices[
head_and_shoulders_pattern = (data
'Close'] > data_prices['MA50']) & \
(data_prices['Close'].shift(-2) > data_prices['Close'].shift(-1)) & \
(data_prices[
(data
'Close'].shift(-1) < data_prices['Close'])

# Menampilkan grafik
plt.figure(figsize=(10, 6))
plt.plot(data_prices[
plt.plot(data
'Close'], label='Close Price', alpha=0.5)
plt.plot(data_prices['MA50'], label='MA50', linestyle='--', alpha=0.5)
plt.scatter(data_prices.index[head_and_shoulders_pattern], data_prices[
plt.scatter(data
'Close'][head_and_shoulders_pattern], marker='^', color='g', label='Head and Shoulders Pattern')
plt.legend()
plt.show()
Trend Analysis

Feragatname