Support Board
Date/Time: Sun, 15 Jun 2025 07:22:49 +0000
Volume greater than previous range of bars
View Count: 201
[2025-05-28 02:52:23] |
User882351 - Posts: 7 |
I've read the documentation on referencing a range of data and cannot figure out why this formula isn't working Study/Chart Alerts And Scanning: Referencing A Range of Data I would like to get an alert if the volume of the current bar is greater than volume from the last 100 bars. I'm using this formula: =(ID1.SG1 > ID1.SG1[0:-100]) What am I doing wrong? |
[2025-05-28 14:20:23] |
John - SC Support - Posts: 40422 |
What you are doing is specifically stated as something that will not work in the documentation you reference. It is the last paragraph that states the following: It needs to be understood that you cannot compare a range of individual values using a comparison operator to a single value. For example, this is not valid: =SG1[0:-10] > 100 . It inherently makes no sense because 11 different values cannot be compared to a single value. This requires an iteration which is not possible with Spreadsheet formulas.
What you can do is use the MAX() function to get the largest value of the last 10 bars and then compare that to the current bar. So your formula would be the following: =ID1.SG1 > MAX(ID1.SG1[-1:-10]) For the most reliable, advanced, and zero cost futures order routing, use 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: