Login Page - Create Account

Support Board


Date/Time: Fri, 01 Nov 2024 03:27:30 +0000



SC closes instantly when writing to the Chart with ACSIL Tools

View Count: 572

[2021-08-14 09:33:50]
PS2004 - Posts: 47
Hi!
What kind of error can occur related to writing text to the Chart with Tools, which forces SC to close instantly?

The goal of the ACSIL Custom Study is to make statistics about Signals.
I want to write the results of the statistics to the Chart.
When I launch the Study, the Sierra Chart crashes intantly, without any Log or sign.
[2021-08-14 09:46:42]
Sierra Chart Engineering - Posts: 104368
There would be an exception or possibly a stack corruption is occurring. Refer to help topic 17:
Sierra Chart Unexpectedly Shutting Down | Memory Errors | Unusual Software Problems | Exception Errors | Freezing of User Interface
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-08-14 10:15:57]
PS2004 - Posts: 47
It may be stack corruption, but I don't use any arrays when I format the text.
Here are a few examples how the text is formatted:

float Reached_Hundred_Percent, Reached_Stop_Percent;
if (Cases != 0) {
  Reached_Hundred_Percent = Reached_Hundred / Cases * 100;
  Reached_Stop_Percent = Reached_Stop / Cases * 100;
}
else Reached_Hundred_Percent = Reached_Stop_Percent = 0;

//Formatting SCString
Text.Format("Reached 100: %.2f", Reached_Hundred_Percent);
Text.AppendFormat("\nReached Stop First: %.2f", Reached_Stop_Percent);
//Writing out Input setting
Text.AppendFormat("\nWriteToFile active: %i", WriteToFile_input.GetYesNo());

Another thing may worth mentioning: I use an own header file to make coding more efficient, and I add Tools that way. The text is added the following way:

DrawOnScreenText(sc, LineNumber, OnScreenText_Vertical_input.GetInt(), OnScreenText_Horizontal_input.GetInt(),
sc.GraphRegion, OnScreenText_Customization_SG, Text);

[2021-08-14 10:55:13]
Sierra Chart Engineering - Posts: 104368
You really need to do step-by-step debugging to determine the problem:

Step-By-Step ACSIL Debugging
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-08-14 12:22:49]
PS2004 - Posts: 47
Allow me one last question:
I read the documentation about additional header files here:
Advanced Custom Study Interface and Language (ACSIL): Using Additional Header Files

I realised that I made a mistake, and placed the header file under the "#include "sierrachart.h"" and not above.
Can it cause this issue?
I included my own and other header files this way in various other Custom Studies too, but I had not encounter this problem until now.
Naturally I will correct the issue, and rebuild all of them.
But what kind of issues can this mistake generate later on?
Date Time Of Last Edit: 2021-08-14 12:33:22
[2021-08-14 19:51:16]
Sierra Chart Engineering - Posts: 104368
We do not think the placement of the header file is the cause of the issue. That can cause compiler errors but that is all.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to 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