Login Page - Create Account

Support Board


Date/Time: Sat, 23 May 2026 01:26:34 +0000



Post From: ACSIL Help.. while loop exploding SC

[2026-05-22 20:42:13]
User884965 - Posts: 3
Hello,

I'm trying to create a custom study. At certain points in the code I have while loops that look something like:


if (x1 > y1)
{
sc.AddMessageToLog("x1 > y1");

while (true)
{
sc.AddMessageToLog("x1 > y1, while (true)");

if (x2 >= y2)
break;
if (x3 <= y3)
continue;
}
}

The study runs fine until one of the while loops are hit, at which time the Sierra Chart program crashes.

The messages were added for debugging after the first few time it crashed. The logs show the equivalent of:

2026-05-22 00:00:00.000| Messages | x1 > y1
2026-05-22 00:00:00.000| Messages | x1 > y1, while (true)
2026-05-22 00:00:09.500| Messages | x1 > y1, while (true) | Number times message previously added: 42003603
(with both automatic and manual looping if that matters)

I need the computing to stay inside the while loop until the condition is met which breaks it (x2 >= y2 in the example).
I also need SC to not loop through so fast that it K/O's itself. I tried looking through the looping documentation but couldn't find anything that looked like it would solve this issue.

Am new to ACSIL and aware that the issue may be entirely my coding. Any help is appreciated.