For this I will just write a new solution from scratch. Much easier than trying modify a previous solution to fit this request.
Something very important to note about this request. The crossing of the MACD Value plot with the MACD Average plot is the same exact thing as the MACD Histogram crossing above and below zero. That's just the way the MACD is constructed.
Here is the code you requested. "Boolean Arrows" can only be plotted on the upper price graph. So when you requested those it automatically means you want the arrows plotted on the upper price graph as opposed to plotting on the lower MACD study. In the screenshot below I have included two lowers studies of the MACD only so that you can see the arrows on the upper price graph line up with the crossover points you requested.
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] < average[1] and value > average;
crossAbove.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
plot crossBelow = value[1] > average[1] and value < average;
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);
Edit: In the comments section below we have a request to convert this code to display on the lower subgraph. I hope this does not break the alerts. Check it out and let us know.
declare lower;
input fastLength = 12;
input slowLength = 26;
input macdLength = 9;
input macdAverageType = AverageType.EXPONENTIAL;
plot value = MovingAverage(macdAverageType, close, fastLength) - MovingAverage(macdAverageType, close, slowLength);
plot average = MovingAverage(macdAverageType, value, macdLength);
plot zeroLine = 0;
plot crossAbove = if value[1] < average[1] and value > average then value else Double.NaN;
crossAbove.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
plot crossBelow = if value[1] > average[1] and value < average then value else Double.NaN;
crossBelow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
Alert(!IsNaN(crossAbove), "MACD Value Cross Above Average", Alert.BAR, Sound.RING);
Alert(!IsNaN(crossBelow), "MACD Value Cross Below Average", Alert.BAR, Sound.RING);