Need an arrow alert and sound for EMAs crossover


0
0

Happy New Year Peter,

I need an arrow and sound alert if possible using MovAvgWeighted the specs and examples have been attached.

I need the arrow and sound to alert when EMA 5 yellow crosses the other two EMAs 85 and 75 red has to cross through both to be a good signal.

Thanks

Attachments:
RESOLVED
Marked as spam
Posted by (Questions: 4, Answers: 23)
Asked on January 7, 2018 11:56 pm
229 views
0
Private answer

Your screenshots only show the bare minimum. So it is not possible for me to provide you a screenshot showing the exact signals you have carefully marked in shaded rectangles. I don’t understand, but this is very common among our visitors. They provide a pinhole view through which to view the entire universe. Lot’s of important details are left out. Very common, almost everyone does this. I have no idea why. Especially since I am so careful to set the standard by always presenting full charts in everything I publish. Ok, off the soap box and back to the task at hand.

You did not express any desire to understand how to write this code. So I won’t provide any explanation. Here is the code:

input fastLength = 5;
input midLength = 75;
input slowLength = 85;
#---------- Weighted Moving Averages
plot fastWMA = WMA(close, fastLength);
plot midWMA = WMA(close, midLength);
plot slowWMA = WMA(close, slowLength);
#---------- Trend
def trendUp = midWMA > slowWMA;
def trendDown = midWMA < slowWMA;
#---------- Crosses
def crossingUpMid = fastWMA[1] < midWMA[1] and fastWMA > midWMA;
def crossingUpSlow = fastWMA[1] < slowWMA[1] and fastWMA > slowWMA;
def crossingDownMid = fastWMA[1] > midWMA[1] and fastWMA < midWMA; def crossingDownSlow = fastWMA[1] > slowWMA[1] and fastWMA < slowWMA; plot crossesUp = (midWMA > slowWMA and crossingUpMid) or (slowWMA > midWMA and crossingUpSlow);
plot crossesDown = (midWMA < slowWMA and crossingDownMid) or (slowWMA < midWMA and crossingDownSlow);
#---------- Style statements
crossesUp.SetDefaultColor(Color.CYAN);
crossesUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
crossesDown.SetDefaultColor(Color.MAGENTA);
crossesDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
#---------- Alerts
Alert(crossesUp, "Crossing Up", Alert.BAR, Sound.RING);
Alert(crossesDown, "Crossing Down", Alert.BAR, Sound.RING);

Screenshot below shows this indicator plotted on a daily chart of Apple.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4089)
Answered on January 8, 2018 10:53 am
0
Private answer

Okay thanks this works for me not sure how much more you need explained to you but you gave me what I needed.

Thanks again

Marked as spam
Posted by (Questions: 4, Answers: 23)
Answered on January 8, 2018 1:04 pm
0

I think it would been best if I had been able to present a screenshot using the stock ticker and time frame you used in your original request. Since you did not include the entire chart I could not bring up that same exact chart. It is only the difference between Good Enough and The Best. I like to shoot for the best.

( at January 8, 2018 2:31 pm)