Login Page - Create Account

Support Board


Date/Time: Mon, 15 Sep 2025 22:55:32 +0000



[Programming Help] - Alert if Price touched e.g Moving average

View Count: 772

[2022-07-25 12:03:39]
User361939 - Posts: 169
Hello,
I am trying to create alert if price cross or only touched e.g moving avarage level.
With this formula i get only alert when price cross moving avarage. I want to have alert even price didn't "cross" but just touched moving avarage. How should looks formula to cover this outcome?
=OR (CROSSFROMABOVE(C, ID29.SG1), CROSSFROMBELOW (C, ID29.SG1))

Best Regards
[2022-07-25 12:34:28]
Sawtooth - Posts: 4263
Try this:
=OR (CROSSFROMABOVE(L, ID29.SG1), CROSSFROMBELOW (H, ID29.SG1))

Note that all comparisons are always from one bar to another; there is no intrabar comparison.
[2022-07-25 14:11:29]
User361939 - Posts: 169
Thank you, but still it is only showing alert when price cross.
What should be in formula to cover case i attached?
imageScreenshot_3.png / V - Attached On 2022-07-25 14:11:24 UTC - Size: 8.11 KB - 149 views
[2022-07-25 17:04:09]
Sawtooth - Posts: 4263
What should be in formula to cover case i attached?
The formula I gave in post #2 will alert when the Low crosses the MA, with the setting used in the attached pic.

Put the formula on the Alerts tab of the Color Bar Based On Alert Condition study so you can see where the alerts occur.
imageLow crosses MA alert.PNG / V - Attached On 2022-07-25 17:03:40 UTC - Size: 24.78 KB - 160 views

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

Login

Login Page - Create Account