Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 15:17:33 +0000



[User Discussion] - Alert Question

View Count: 1017

[2014-11-05 21:49:25]
infpz - Posts: 826
If a line's (ID2.SG1) slope has been down for the last 5 bars and another line (ID3.SG1) has crosses the original line (ID2.SG1) from below, then show a red arrow.

And this is what I am using:

=AND(CROSSFROMBELOW(ID3.SG1,ID2.SG1),ID2.SG1[0]=ID2.SG1[-5])

Should I be getting the alert each time this condition occurs, or do you see an error in my code?

Thanks,
Patrick
[2014-11-05 22:43:01]
Sawtooth - Posts: 3993
Try this:
=AND(CROSSFROMBELOW(ID3.SG1,ID2.SG1),ID2.SG1[0]<ID2.SG1[-1],ID2.SG1[-1]<ID2.SG1[-2],ID2.SG1[-2]<ID2.SG1[-3],ID2.SG1[-3]<ID2.SG1[-4],ID2.SG1[-4]<ID2.SG1[-5])

If you add the Color Bar Based On Alert Condition study, and put this formula on its Alerts tab, you will have a visual of where the alerts will be.
[2014-11-06 12:58:45]
infpz - Posts: 826
Thank you Tom,

If you have a moment, please see attached. The chart on the left is the original. On the right is a duplicate with your code substituted. You can see on the left a signal exists on the left (red arrow, barely visible) as the line is sloping down, and the lines cross as specified, but on the chart on the right it does not show. So I think there might be something amiss. If you have the spare time to look again, that would be great. I will keep at it either way.

Thanks,
Patrick Z
image12345.png / V - Attached On 2014-11-06 12:55:03 UTC - Size: 39.29 KB - 330 views
[2014-11-06 14:07:19]
Sawtooth - Posts: 3993
My formula works on my test chart. It signals when ID3.SG1 crosses ID2.SG1 from below, and there are 5 consecutive previous downslopes of ID2.SG1, where ID3.SG1 is the slower of the two MAs.

I find it easier to base the crossover on the faster MA. (The first ID# in the formula is the what crosses the second.):
=CROSSFROMBELOW(fasterMA,slowerMA)
Date Time Of Last Edit: 2014-11-06 14:07:32
[2014-11-06 16:23:54]
Sawtooth - Posts: 3993
Referring to the example pic, if ID3 is the black line and ID2 is the magenta line, then my formula should work.
Date Time Of Last Edit: 2014-11-06 16:29:52

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

Login

Login Page - Create Account