Login Page - Create Account

Support Board


Date/Time: Sun, 16 Jun 2024 18:08:13 +0000



Breaking up Halftrend study to use in a Simple Alert

View Count: 197

[2023-12-16 07:09:28]
pjk0225 - Posts: 25
The "Halftrend" study has a plot, sg1, that auto-colors based on its own rules, one color for the "Up" condition, another for "Down".
I'd like to create a simple alert that references each condition separately for the entire duration one of them is valid.
So if the "Down" condition is True, the simple alert would tell me so until it is no longer true.
Is it possible to split up the sg1 plot like this? Any pointers would be appreciated.
[2023-12-16 15:22:41]
Sawtooth - Posts: 4024
I'd like to create a simple alert that references each condition separately for the entire duration one of them is valid.
Since the colors alternate at every arrow, use SG2 and SG3 in a formula like this in the Spreadsheet Formula study's Formula field:
=IF(ID2.SG2>0,1,IF(ID2.SG3>0,-1,ID3.SG1[-1]))
where ID2 is the Halftrend study.

This formula creates a persistent value each time the arrows alternate.
It will return 1 for an 'up' condition, and a -1 for a 'down' condition, for the duration of each condition.

You can then use the Spreadsheet Formula's output to color price bars, etc., using the Color Bar Based On Alert Condition study.
[2023-12-16 15:34:56]
pjk0225 - Posts: 25
I see. I supppose this is beyond the scope of what simple alerts are capable of? I'm still new to using Sierra Charts so I haven't had the chance to explore the spreadsheet system, but I'll give it a try when I have the time.
[2023-12-16 16:01:51]
Sawtooth - Posts: 4024
I suppose this is beyond the scope of what simple alerts are capable of?
Despite its name, the Spreadsheet Formula study is not a spreadsheet study; it uses Alert syntax, not spreadsheet syntax.

So it's entirely possible with simple alerts.
Date Time Of Last Edit: 2023-12-16 16:04:57
imageHalftrend coloring.PNG / V - Attached On 2023-12-16 16:04:51 UTC - Size: 16.92 KB - 47 views
[2023-12-16 16:13:55]
pjk0225 - Posts: 25
Oh I didn't realize. That should be very simple then. Thank you for your help :)

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

Login

Login Page - Create Account