I'm surprised this hasn't already been posted. Thanks.
The modifications are extremely minor. Only two lines of code need to be changed and those changes are listed here for those trying to learn:
plot crossAbove = value[1] < 0 and value > 0;
plot crossBelow = value[1] > 0 and value < 0;
Here is the complete solution after those changes have been applied:
input fastLength = 12;
input slowLength = 26;
input macdLength = 9;
input macdAverageType = AverageType.EXPONENTIAL;
def value = MovingAverage(macdAverageType, close, fastLength) - MovingAverage(macdAverageType, close, slowLength);
def average = MovingAverage(macdAverageType, value, macdLength);
plot crossAbove = value[1] < 0 and value > 0;
crossAbove.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
plot crossBelow = value[1] > 0 and value < 0;
crossBelow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
Alert(crossAbove, "MACD Value Cross Above Average", Alert.BAR, Sound.RING);
Alert(crossBelow, "MACD Value Cross Below Average", Alert.BAR, Sound.RING);