Support Board
Date/Time: Wed, 26 Feb 2025 06:55:37 +0000
[User Discussion] - Using “color background based on alert condition” for the “zig zag” stud
View Count: 843
[2021-05-12 00:11:33] |
9710276 - Posts: 24 |
Hi I’m using the “color background based on alert condition” study to create an alert condition for the “zig zag” study. I’d like to color the background GREEN when a HH precedes a LH. The documentation says the ZigZag study uses a value of 2 for a HH -- and a value of 3 for a LH Zig Zag: Text Labels Subgraph Description SETUP --------------------------- 1 -- The ZigZag study is ID12 on my chart 2 -- My “color background based on alert condition” formula is as follows: =AND(ID12,SG2[0]=3, ID12,SG2[-1]=2) 3 – Nothing happens. I verified the alert is enabled (check box is checked). Thanks for the help. This seems like it should be simple – not sure what I’m missing. |
[2021-05-12 03:21:21] |
Sawtooth - Posts: 4175 |
The HH, LH, LL, HL values only occur at the ZZ leg; they are not persistent until the subsequent leg. Note: Also set 'Display HH,LH,LL,HL Labels (ln:23)' to Yes. To get the alert you want, use the Spreadsheet Formula study to make them persistent. - Add the Spreadsheet Formula study. - Use a formula like this in the Formula field: =IF(ID12.SG2=2,ID12.SG2,IF(ID12.SG2=1,ID12.SG2,ID13.SG1[-1])) where the Spreadsheet Formula study is ID13. Then use an alert formula like this, referencing the Spreadsheet Formula study: =AND(ID13.SG1=1,ID13.SG1[-1]=2) Date Time Of Last Edit: 2021-05-12 12:02:06
|
[2021-05-12 04:22:28] |
9710276 - Posts: 24 |
Awesome -- thanks for all the details! Now I need to learn spreadsheets! = ) |
[2021-05-12 11:39:56] |
Sawtooth - Posts: 4175 |
Now I need to learn spreadsheets!
Despite its name, the Spreadsheet Formula study is not a spreadsheet study. It uses Simple Alert syntax.
|
[2021-05-12 12:05:15] |
Sawtooth - Posts: 4175 |
The formulas in Post#2 have been corrected, for 2 reasons: 1. LH is 1 not 3. LH (Lower High) = 1 HH (Higher High) = 2 HL (Higher Low) = 3 LL (Lower Low) = 4 2. HH and LH are never sequential so HL and LL need to be ignored. Date Time Of Last Edit: 2021-05-12 12:19:00
|
[2021-05-13 00:13:10] |
9710276 - Posts: 24 |
Thanks again! Plan to work on this over the weekend!
|
To post a message in this thread, you need to log in with your Sierra Chart account: