Login Page - Create Account

Support Board


Date/Time: Sun, 15 Jun 2025 16:05:52 +0000



[Programming Help] - Which one of these formulas is more CPU friendly in Spreadsheet Studies?

View Count: 216

[2025-06-03 17:29:39]
C_Money - Posts: 83
In SC's spreadsheet study, which of these is more CPU efficient:

1)
MAX(A3:A40) = 3

2)
MOSTRECENTNONZEROVALUE(A3:A40) = 3

Trying to optimize my charts because I use a lot of
MOSTRECENTNONZEROVALUE
with huge ranges and chart recalculations typically take over 1000ms to complete.
[2025-06-03 17:35:23]
John - SC Support - Posts: 40422
The MAX() function is going to be more efficient overall, as there is less looping to determine the particular value. Although we can not say how much more efficient one is over another.

But, these two functions (MAX() and MOSTRECENTNONZEROVALUE()) perform two different things. You will not get the same result from those two functions.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2025-06-03 17:35:34
[2025-06-03 17:38:49]
C_Money - Posts: 83
The MAX() function is going to be more efficient overall, as there is less looping to determine the particular value. Although we can not say how much more efficient one is over another.

But, these two functions (MAX() and MOSTRECENTNONZEROVALUE()) perform two different things. You will not get the same result from those two functions.

Got it, thanks. Yeah the only 2 numbers the cells they are referencing would only ever return either a 3 or a 0 so that's why I was wondering if MAX would have been a better fit. Is there a better function than MAX that would be more efficient in this case?
[2025-06-03 18:49:00]
John - SC Support - Posts: 40422
Is there a better function than MAX that would be more efficient in this case?

Not that we can think of for what you are doing.
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:

Login

Login Page - Create Account