Support Board
Date/Time: Mon, 25 Nov 2024 05:54:30 +0000
Count Number of times of New Alert Condition Since Previous Color Bar Alert Triggered
View Count: 257
[2024-03-29 11:23:45] |
User664207 - Posts: 9 |
Using Color Bar Based on Alert and/or Spreadsheet Formula study, how can I keep track of this kind of scenario: 1) Color Bar Based on Alert Condition is True, say a Long Signal (ID1.SG1) 2) Then while #1 being true, start to track number of times a lower low occurs, L<L[-1] 3) Cancel counting running total of Lower Lows based on Color Bar Short Signal being true (ID1.SG2) I tried hacking a solution with custom code using a persistent variable but my coding skills aren't great and can't seem to get it to count correctly. So either maybe there is a better example of this in the code base I can refer to for help, or a much easier way to do it? Thanks for any help!! |
[2024-03-29 14:15:11] |
John - SC Support - Posts: 36238 |
The only thing we can point you to that we think is in line with what you are trying to do is the following: Spreadsheet Example Formulas and Usage: Formula to Count Bars Since An Event For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2024-03-29 14:46:43] |
User664207 - Posts: 9 |
That’s only counting bars since event. I’m trying to count events since event. Anything else out there to help? Thank you!
|
[2024-03-29 15:49:04] |
Sawtooth - Posts: 4120 |
Here's a spreadsheet syntax solution: =IF(AND(K4=0,K3=1),0,IF(D3<D4,O4+1,O4)) where this formula is in cell O3. This assumes the TRUE in K3 is persistent until there is a short signal. To convert this to the Spreadsheet Formula study, which uses Alert syntax: =IF(AND(ID1.SG2=0,ID1.SG1=1),0,IF(L<L[-1],ID2.SG1[-1]+1,ID2.SG1[-1])) where ID2 is this Spreadsheet Formula study. |
[2024-03-29 15:54:04] |
User664207 - Posts: 9 |
Thank you very much!
|
To post a message in this thread, you need to log in with your Sierra Chart account: