code: def moving_average_convergence_divergence(data, short_period, long_period):
      
      catch_errors.check_for_period_error(data, short_period)
      catch_errors.check_for_period_error(data, long_period)
  
      macd = ema(data, short_period) - ema(data, long_period)
      return macd
docs: Moving Average Convergence Divergence.
  
      Formula:
      EMA(DATA, P1) - EMA(DATA, P2)