def ichimoku(dataframe, conversion_line_period=20, base_line_periods=60,
    laggin_span=120, displacement=30):
    """Ichimoku cloud indicator"""
    df = dataframe.copy()
    high_9 = df['high'].rolling(window=conversion_line_period).max()
    low_9 = df['low'].rolling(window=conversion_line_period).min()
    df['tenkan_sen'] = (high_9 + low_9) / 2
    high_26 = df['high'].rolling(window=base_line_periods).max()
    low_26 = df['low'].rolling(window=base_line_periods).min()
    df['kijun_sen'] = (high_26 + low_26) / 2
    last_index = df.iloc[-1:].index[0]
    last_date = df['date'].iloc[-1].date()
    df['senkou_span_a'] = ((df['tenkan_sen'] + df['kijun_sen']) / 2).shift(26)
    high_52 = df['high'].rolling(window=laggin_span).max()
    low_52 = df['low'].rolling(window=laggin_span).min()
    df['senkou_span_b'] = ((high_52 + low_52) / 2).shift(displacement)
    df['chikou_span'] = df['close'].shift(-displacement)
    return {'tenkan_sen': df['tenkan_sen'], 'kijun_sen': df['kijun_sen'],
        'senkou_span_a': df['senkou_span_a'], 'senkou_span_b': df[
        'senkou_span_b'], 'chikou_span': df['chikou_span'], 'cloud_green': 
        df['senkou_span_a'] > df['senkou_span_b'], 'cloud_red': df[
        'senkou_span_b'] > df['senkou_span_a']}
