Test 
2024-12-08

import pandas as pd

def ichimoku(df):
    # Calculate the Ichimoku components
    high_9 = df .rolling(window=9).max()
    low_9 = df .rolling(window=9).min()
    df  = (high_9 + low_9) / 2  # Conversion Line

    high_26 = df .rolling(window=26).max()
    low_26 = df .rolling(window=26).min()
    df  = (high_26 + low_26) / 2  # Base Line

    df  = ((df  + df ) / 2).shift(26)  # Leading Span A
    df  = ((df .rolling(window=52).max() + df .rolling(window=52).min()) / 2).shift(26)  # Leading Span B

    df  = df .shift(-26)  # Lagging Span

    return df

# Example usage:
# df = pd.read_csv('your_data.csv')  # Load your data
# df = ichimoku(df)
# print(df [ ])
