Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 17:34:31 +0000



Restart of spreadsheets calculations on new session.

View Count: 291

[2023-03-31 15:48:43]
Spartan79 - Posts: 54
Hi.

I have some calculations using spreadsheet study. I need the calculations to reset at new session. I looked around and didn't find a way.

Right now, when I have couple days on the chart it calculates the data for all the days loaded. Ideally I don't want to load each individually for backtesting.

Is there a way to reset the spreadsheet calculation on new session?

Thank you.
[2023-03-31 18:15:45]
John - SC Support - Posts: 31355
You can control the number of "Bars" that are calculated within the spreadsheet through the Input for Number of Rows. Refer to the following:
Spreadsheet Study Inputs: Number of Rows

If you are wanting to only have a particular calculation performed on the current session, then you would have to add a test for the Date and/or Time (depending on when exactly you want to start the calculation) and add that into your calculation. For example, to test if the Day of the month is the same as today's day of the month, you would enter the following:
=DAY(TODAY())

You can then use this with an IF statement to only get calculations for bars that are on the same day of the month as today, for example:
= IF(DAY(A3) = DAY(TODAY()), X, Y)

Where X is the calculation you want when true and Y is the calculation/value you want when false (typically 0).
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-03-31 23:51:20]
Spartan79 - Posts: 54
Yes, it's easy to get calculations just for the current day.

However what I would like to achieve is to have multiple days loaded and have the calculations reset for each trading day (either globex or RTH, doesn't matter), not just today. Sort of like VWAP, that can be set to reset on the new day.

The way spreadsheet calculations work right now is like rolling VWAP of all the days loaded (or Volume Profile for all loaded bars). I want spreadsheet calculations to reset every trading day like daily VWAP (or daily Volume Profile) for all loaded days. Hope that explains better what I want to achieve.

Otherwise when I want to backtest a strategy based on said spreadsheet study, I have to load one day at a time. Which is not ideal.
[2023-04-03 14:01:12]
John - SC Support - Posts: 31355
There really is not a built-in way to "reset" studies that are not already built with that functionality. Depending on the particular study you are wanting to Reset, you may be able to modify the code to do what you want. Refer to the following:
How to Build an Advanced Custom Study from Source Code
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-04-03 21:44:50]
Sawtooth - Posts: 3992
I want spreadsheet calculations to reset every trading day
Something like this?:
https://www.sawtoothtrade.com/free-stuff-18.html
[2023-04-04 00:28:44]
Spartan79 - Posts: 54
I'm referring to spreadsheet study here, as I haven't found any other study to do what I want. Was wondering if there's a way to reset the calculations for new session in the spreadsheet.

That looks like it might be it tomgilb. Will check it out.

Thank you.

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

Login

Login Page - Create Account