Login Page - Create Account

Support Board


Date/Time: Thu, 23 Jan 2025 03:16:57 +0000



Bug with sc.ArraySIze

View Count: 670

[2018-10-29 13:24:33]
User470516 - Posts: 78
Dear SC Team,

About 2 to 3 weeks ago, several of my studies which were working fine started to litterally blow SC off. I think it happened after an update but I cannot tell which version. I run the very latest version.

I initially thought that was related to "Numeric Info Table Graph Draw Type" for which I was asked to wait for the newest version.

I just found out it is due to the use of sc.ArraySize in any configuration.

To make it simple please use the following code found here (with nothing else): https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Variables_And_Arrays.html#scArraySize:
for (int i = 0; i < sc.ArraySize; ++i)
  {
    // SC_LAST is for the Close values in OHLC bars
    debug = sc.BaseDataIn[SC_LAST];
  }
with the proper surrounding code and that will blow SC. I then need to kill the process.

1- Can you reproduce that?

Thank you for your support.

Regards,

Laurent

[2018-10-29 16:59:32]
Sierra Chart Engineering - Posts: 104368
debug = sc.BaseDataIn[SC_LAST];
This does not make sense. This is incomplete. The second dimension is not specified and we do not know what debug is.

Also, that example is not efficient and we will update it now.
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
[2018-10-29 17:03:44]
Sierra Chart Engineering - Posts: 104368
Here is the proper code example:
// Copy all the Close elements from the BaseDataIn array
// to the Data array of the first Subgraph.
// This example assumes that sc.AutoLoop = 0 (manual looping).

for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; ++BarIndex)
{
// SC_LAST is for the Close values in OHLC bars
sc.Subgraph[0].Data[BarIndex] = sc.BaseDataIn[SC_LAST][BarIndex];
}

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
[2018-10-29 20:14:14]
User470516 - Posts: 78
Thank you for your message.

1- I beg your pardon, I don't know what happened during the cut&paste. debug was SCSubgraphRef debug = sc.Subgraph[0]. But neverver
mind:
2- I have used the new piece of code you submitted me with and I have the same problem: it scratches the platform, no
recovery possible. I ran new tests; here are the conditions:
- DYZ18 contract,
- date range (chart settings): 2017-05-23 to 2018-05-22
- one single chartbook with one single study with the code example you submitted only
- scratches for 1mn and 3mn, ok for larger time periods
As said in my ealier post, it worked 3 weeks ago before I updated SC, in heavy loaded environments.

Please tell me if you can reproduce this.

I remain at your disposal.

Thank you for your support.

Regards,

Laurent
[2018-10-29 21:00:07]
Sierra Chart Engineering - Posts: 104368
What do you mean by "scratches the platform"?

If you notice Sierra Chart freeze, then just wait until you notice it unfreeze. This would mean that there is a long time to do the calculations but there must be something else you are doing in the study function if it is taking that long.

But we think we understand the basic problem. You are using a loop which is meant for manual looping. So you must set sc.AutoLoop = 0 in the SetDefaults code block at the top of the function.
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
Date Time Of Last Edit: 2018-10-29 21:00:58

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

Login

Login Page - Create Account