def moving_avg_features(df):
  """
      Function to calculate the exponential moving averages and moving averages over different intervals of days
      Input: Dataframe
      Output: Dataframe with new moving average features
  """

  df['EMA_9'] = df['Close'].ewm(9).mean().shift()
  df['EMA_9'] = df['EMA_9'].fillna(0)
  df['SMA_5'] = df['Close'].rolling(5).mean().shift()
  df['SMA_5'] = df['SMA_5'].fillna(0)
  df['SMA_10'] = df['Close'].rolling(10).mean().shift()
  df['SMA_10'] = df['SMA_10'].fillna(0)
  df['SMA_15'] = df['Close'].rolling(15).mean().shift()
  df['SMA_15'] = df['SMA_15'].fillna(0)
  df['SMA_30'] = df['Close'].rolling(30).mean().shift()
  df['SMA_30'] = df['SMA_30'].fillna(0)
  return df