Alert for candlestick closed above or below EMA


Category:
0
0

So im trying to get alerted for when the stock’s candlestick closed above or below an exponential moving average of mine. Is that even possible?

Marked as spam
Posted by (Questions: 2, Answers: 1)
Asked on January 17, 2019 9:40 pm
201 views
0

If I can get it in a form of scanner watchlist that would be amazing as well.

( at January 17, 2019 9:54 pm)
0
Private answer

This should do it for the chart study with alerts. If you want this in a watchlist you will need to post a request for that in the Watchlist topic:

input length = 21;
input averageType = AverageType.EXPONENTIAL;
input price = close;
def ma = MovingAverage(averageType, price, length);
plot crossAbove = close[1] < ma[1] and close > ma;
crossAbove.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
crossAbove.SetDefaultColor(Color.CYAN);
crossAbove.SetLineWeight(3);
plot crossBelow = close[1] > ma[1] and close < ma;
crossBelow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
crossBelow.SetDefaultColor(Color.MAGENTA);
crossBelow.SetLineWeight(3);
Alert(crossAbove, "Cross Above", Alert.BAR, Sound.RING);
Alert(crossBelow, "Cross Below", Alert.BAR, Sound.RING);

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 18, 2019 11:01 am