Login Page - Create Account

Support Board


Date/Time: Sun, 08 Sep 2024 00:27:28 +0000



Ma crossover alert with downtrending condition for at least 30 bars.

View Count: 110

[2024-07-23 16:28:43]
User409381 - Posts: 2
Hello,

Im trying to get an alert on MA crossover but with a condition, and then send it to telegram bot.

MA 7 is Avg1(SG1)
MA 35 is Avg2(SG2)
Cross from bottom is (SG3)

My condition : SG2 is in downtrending for a least 30 bars(30 min in that case), and only if it has been the case (ignore every other crossing), get an alert on next cross over from SG1 from bottom----> get SG3 (point, star...)

Next : send an alert to telegram bot.

Thank you
imageMA crossover.png / V - Attached On 2024-07-23 16:26:58 UTC - Size: 18.61 KB - 26 views
[2024-07-23 17:29:56]
John - SC Support - Posts: 34254
How do you do this will depend on how you want to define a "Downtrend" for the MA35.

If it is enough that the current value is less than the value 30 bars previously, then the following formula would work to test this.:
=SG2 < SG2[-30]

But if you require that the trend has been down at each bar along the way, then you would need to test each bar against the previous, so your test for this would look like the following:
=AND(SG2[-29] < SG2[-30], SG2[-28] < SG2[-29], SG2[-27] < SG2[-28], ...)

We are not sure what item you are wanting to test in the crossover, but if you are testing SG2 crossing from below against SG1, then the following could be your alert condition:
=AND(SG2 < SG2[-30], CROSSFROMBELOW(SG2, SG1))

All of the information on alerts can be found on the following page:
Study/Chart Alerts And Scanning
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account