Login Page - Create Account

Support Board


Date/Time: Fri, 07 Feb 2025 18:01:38 +0000



[User Discussion] - moving averages color alert

View Count: 1374

[2016-03-08 15:20:16]
User147893 - Posts: 10
hi,

I'm using the simple 'moving averages' indicator that comes with the sierra charts...

in there I have 3 moving averages that color green or red based on slope as is built into the indicator study.

how do I get an alert when all 3 moving averages turn green, or when all 3 turn red?

alert should fire only once on the close of first bar for each sequence of all green or for each sequence of all red...

thank you for your help...

Regards,

Rupe
[2016-03-08 17:38:08]
Sawtooth - Posts: 4173
Try this:
=OR(AND(ID1.SG1[-1]<ID1.SG1[-2],ID1.SG1>ID1.SG1[-1],ID1.SG2>ID1.SG2[-1],ID1.SG3>ID1.SG3[-1]),
AND(ID1.SG1>ID1.SG1[-1],ID1.SG2[-1]<ID1.SG2[-2],ID1.SG2>ID1.SG2[-1],ID1.SG3>ID1.SG3[-1]),
AND(ID1.SG1>ID1.SG1[-1],ID1.SG2>ID1.SG2[-1],ID1.SG3[-1]<ID1.SG3[-2],ID1.SG3>ID1.SG3[-1]))

where the Multiple Averages study is ID1, edit as needed.

This will alert at the first occurrence of all three MAs sloping up.

To get the alert at the first occurrence of all three MAs sloping down, copy/paste the same to another study's Alerts tab, and reverse all of the comparison operators.

Up and down alerts need to be separated because combining them exceeds the 375 character limit for Simple Alerts.

If you'd like to see a visual of which bars will alert, add two instances of the Color Bar Based On Alert Condition study, one for up slope and one for down slope, and use the same formulas in each.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account