Login Page - Create Account

Support Board


Date/Time: Tue, 04 Mar 2025 07:41:59 +0000



[Programming Help] - Counting signal from studies in spreadsheet

View Count: 1656

[2019-02-26 18:27:56]
jenda3 - Posts: 21
Hi,

i use spredsheet and i need count how many times studie give me a signal. I have in spredsheet 1000 rows

For exemple: to static cell J98 i put this If(AND(AA3>0,AB3>0),1,0). This formula give me 1 when condition is true. And in static cell J99 i want count how meny times is "1" in cell J98. So in the beginning it's in the cell J99 "0", when cell J98 gives me "1" tehn in cell J99 is "1" and for exemple after 2000 bars cell J98 gives me again "1" then a need in cell J99 "2" etc...

So the point is - i don't want count bars but situations

Is it possible in spreadsheet?
[2019-02-26 18:55:05]
Sawtooth - Posts: 4179
This is possible, but you'll need to use a Formula Column, not a static cell.
And the count can only increment from row to row, so if the event happens more than once in the same bar, only one event would increment the count.

Here's an example of how to do it:
Spreadsheet Example Formulas and Usage: Count Events Since First Occurrence
[2019-02-26 20:20:59]
jenda3 - Posts: 21
I try this example before i wrote this post. And this does't work the way I need it because i have only 1000 rows in spredsheet. When 1000 bars are gone and the event does't happen then the counter is reset

This event happens only once per bar.
[2019-02-26 20:57:42]
Sawtooth - Posts: 4179
You can set the Number of Rows to a larger number.
[2019-02-26 21:16:38]
jenda3 - Posts: 21
I know, but i use spreadsheet for live trading and when I set more rows then sierra slow down
[2021-12-02 21:34:05]
j4ytr4der_ - Posts: 946
I'm looking for exactly the same thing, just a simple counter to record how many times a buy signal is fired. My spreadsheet uses only 2 rows as I have no interest in recording per bar etc. The signal triggers and then goes to zero so that it is capable of triggering again if needed. But I want to make sure that it's really on firing when it should, and I can't figure out how to create a counter to do it.
[2021-12-02 23:43:56]
Sawtooth - Posts: 4179
It's not possible to count intrabar events; you can only count events from row to row (bar to bar).

So with the Number of Rows set to 2, you won't be able to count more than one event.
[2021-12-03 02:32:46]
j4ytr4der_ - Posts: 946
OK, I suspected as much. Bummer... but thank you for pushing me over to 100% certain.

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

Login

Login Page - Create Account