Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 08:38:23 +0000



[User Discussion] - Alert Conditions

View Count: 1545

[2013-06-22 19:34:21]
drywater0 - Posts: 85
After reading through the documentation and experimenting, it's not clear to me if it is possible to write a slightly nuanced crossover alert. I am using three averages and would like to be alerted when the shortest length has crossed BOTH the medium and long term averages. This often occurs within the space of 10-20 bars but rarely happens on the same bar. Is there logic available that would provide for a lookback period with regard to evaluating such a crossover? Appreciate your advise on this issue.
[2013-06-22 20:30:43]
M5amhan - Posts: 468
ID1 = short
ID2 = med
ID3 = long

=OR(AND((ID1.SG1>ID2.SG1),CROSSFROMBELOW(ID1.SG1,ID3.SG1)),AND((ID1.SG1<ID2.SG1),CROSSFROMABOVE(ID1.SG1,ID3.SG1)))

what this does is when uptrending waits for short to be below med then alerts when it crosses below long.. reverse when downtrending. if theres any other conditions i missed just tell me
[2013-06-22 20:59:38]
drywater0 - Posts: 85
Trade2day1,
Thanks very much for the clever logic. During basing patterns or areas of consolidation, the short will sometimes cross the long first and afterwards cross the medium. However, I can follow your template and add both those as additional conditions within the overall OR statement.

SC Engineering,
Could you please comment if there is a method / function / alternative solution that would provide for a lookback constraint when evaluating conditions. I think this could open up a lot of possibilities across a broad range of studies.

Appreciate everyones help on this thread.


[2013-06-22 21:15:50]
M5amhan - Posts: 468
http://www.sierrachart.com/index.php?l=doc/doc_AlertCondAndScan.html#ReferencingDataOtherLastBar << that is the look back function

i thought about that too about the long first then medium, but if you used the same logic i did then in up trends when the short crosses below the med then back above it you would get alerts every time.. couldnt figure that one out
[2013-07-03 18:18:40]
Sierra Chart Engineering - Posts: 104368
Is there logic available that would provide for a lookback period with regard to evaluating such a crossover?
No. In the case of when using the CROSSOVER function, it works with specific data.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to 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