<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def moving_average_convergence_divergence(data, short_period, long_period):
 """ Moving Average Convergence Divergence. Formula: EMA(DATA, P1) - EMA(DATA, P2) """

    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