def macd(df, n_fast=12, n_slow=26, n_signal=9):
    """Calculate MACD, MACD Signal and MACD difference
    
    :param df: pandas.DataFrame
    :param n_fast: 
    :param n_slow: 
    :return: pandas.DataFrame
    """
    
    EMAfast = df.ewm(span=n_fast, min_periods=n_slow).mean()
    EMAslow = df.ewm(span=n_slow, min_periods=n_slow).mean()
    MACD = EMAfast - EMAslow
    MACDsign = MACD.ewm(span=n_signal, min_periods=n_signal).mean()
    MACDdiff = MACD - MACDsign
    
    return MACD, MACDsign, MACDdiff