Login Page - Create Account

Support Board


Date/Time: Mon, 17 Mar 2025 18:22:48 +0000



[Programming Help] - Technical consideration for non-stop running SC study

View Count: 483

[2022-09-15 04:30:01]
User857150 - Posts: 11
Hello!

I am designing the custom strategy using ACSIL and I faced the problem of the indexing of bars.

Let's say I am running my strategy 24/7 non-stop for a month or more.
I access the sc. Index every time to perform some calculations on a 1 min resolution. Can there arise a problem that due to running a program for months or years the sc.Index reaches infinity thus crushing the program?

Assuming that I am using 1 min graph within months the value of sc.Index may reach high values overflowing int64. How does Siearra work this around?

Is there anything I should take into account in this case?

A crushed program means that the strategy may not exit certain positions set before the crush.
[2022-09-17 16:41:09]
ForgivingComputers.com - Posts: 1028
Assuming that I am using 1 min graph within months the value of sc.Index may reach high values overflowing int64.

Not sure how you figured a 64-bit number will overflow in a matter of months.

x = 2^64 = 18,446,744,073,709,551,616

y = 1 min bars per year = 60*24*365 = 525,600

x/y = years until overflow = 35,096,545,041,304

If you leave the system running without touching it, your computer will run out of memory (RAM and/or Disk) before sc.Index wraps around.

It is a valid concern if you want to maintain a max number of bars on the chart. The Start Date of the chart controls how far back data is loaded. Charts will keep adding bars unless a reload and recalculate is done manually or you can periodically modify the start date with sc.ChartDataStartDate. It will reload the chart after the date change.
ACSIL Interface Members - Variables and Arrays: sc.ChartDataStartDate

Also, consider that you should be doing regular updates of Sierra Chart. Monthly is a good frequency. This will limit the size of the charts. The old SCID files should also be deleted at least annually to keep the Data folder from getting too big.

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

Login

Login Page - Create Account