(df, n)
return out(SETTINGS, df, result)
Commodity Channel Index
Commodity Channel Index
Commodity Channel Index
def CCI(df, n):
    """
    Commodity Channel Index
    """
    PP = (df['High'] + df['Low'] + df['Close']) / 3
    result = pd.Series((PP - PP.rolling(n).mean()) / PP.rolling(n).std(), name='CCI_' + str(n))
    return out(SETTINGS, df, result)
def CCI ( df , n ) : PP = ( df [ 'High' ] + df [ 'Low' ] + df [ 'Close' ] ) / 3 result = pd . Series ( ( PP - PP . rolling ( n ) . mean ( ) ) / PP . rolling ( n ) . std ( ) , name = 'CCI_' + str ( n ) ) return out ( SETTINGS , df , result )