I see that you requested up and down arrows. However your code only contained a signal for crossing above. So here it is with the up arrow and alert based on the signal provided in your original source code:
def ema1 = ExpAverage(close, 50);
def ema2 = ExpAverage(close, 9);
def emaCrossingAbove = ema1[1] < ema2[1] and ema1 > ema2;
plot scan = emaCrossingAbove[-1];
scan.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
scan.SetDefaultColor(Color.CYAN);
scan.SetLineWeight(3);
Alert(scan, "EMA Crossing Above", Alert.BAR, Sound.RING);
Notice I only added 4 lines to your code. And three of those were mere style statements to configure the same elements that can be adjusted from user settings. They really are not required. They are only there to provide default user settings.
Update: The request has been modified to include crosses below as well as crosses above. Here is the code required to add those elements.
def ema1 = ExpAverage(close, 50);
def ema2 = ExpAverage(close, 9);
def emaCrossingAbove = ema1[1] < ema2[1] and ema1 > ema2;
def emaCrossingBelow = ema1[1] > ema2[1] and ema1 < ema2;
plot crossingAbove = emaCrossingAbove[-1];
crossingAbove.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
crossingAbove.SetDefaultColor(Color.CYAN);
crossingAbove.SetLineWeight(3);
Alert(crossingAbove, "EMA Crossing Above", Alert.BAR, Sound.RING);
plot crossingBelow = emaCrossingBelow[-1];
crossingBelow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
crossingBelow.SetDefaultColor(Color.MAGENTA);
crossingBelow.SetLineWeight(3);
Alert(crossingBelow, "EMA Crossing Below", Alert.BAR, Sound.RING);
Hi Pete,
Could I get this study to the upside and downside with alert..
Thanks
I have updated my answer to include the crosses below.