I appreciate Nick jumping in there and providing an answer. However his code does not include the alerts which were a core component of the request. Here is my solution which also provides user inputs for the length and type of moving average.
input length = 50;
input averageType = AverageType.EXPONENTIAL;
plot ma = MovingAverage(averageType, close, length);
plot crossAbove = close < ma and close > ma;
plot crossBelow = close > ma and close < ma;
Alert(crossAbove, "Cross Above", Alert.BAR, Sound.RING);
Alert(crossBelow, "Cross Below", Alert.BAR, Sound.RING);