Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 00:10:19 +0000



[Locked] - sc.ArraySize and sc.Index not updating simultaneously

View Count: 802

[2018-12-14 19:31:59]
User525733 - Posts: 126
Hi,

documentation implies that if sc.ArraySize grew by 1 that sc.Index would immediately also grow by one....not so.

I made a custom study that requires resetting of a persistent var on every new bar. I use a code block from your documentation to detect new bars:

"Detecting New Bars Added to Chart" from:
ACSIL Programming Concepts: Determining New Bars When Chart is Updated

what happens is that sc.ArraySize would get to 135 for instance and sc.Index would still be at 133 (should be 134)...sc.Index only updates to 134 on the second call to the study. This is a problem because sc.Subgraph[0].Data[sc.Index] = persistent_var is getting wrong value.

attached a screen shot from the debugger showing values.

thanks
imageUntitled.png / V - Attached On 2018-12-14 19:31:48 UTC - Size: 16.32 KB - 224 views
[2018-12-14 23:31:41]
Sierra Chart Engineering - Posts: 104368
what happens is that sc.ArraySize would get to 135 for instance and sc.Index would still be at 133 (should be 134)...sc.Index only updates to 134 on the second call to the study.
Yes this is the correct behavior. This is well explained:

ACSIL Interface Members - Variables and Arrays: sc.CurrentIndex / sc.Index
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-12-15 04:53:09]
User525733 - Posts: 126
if sc.ArraySize is at 135 then sc.Index should be 134...not 133 as in the attachment....take a closer look at the pic...and perhaps read the ticket.
[2018-12-15 05:33:25]
Sierra Chart Engineering - Posts: 104368
You need to read the documentation. And understand the functionality. You need to have respect for the functionality and how it is designed and the documentation. Do not post here further again about this.
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-12-15 23:24:34]
Sierra Chart Engineering - Posts: 104368
Also we did block your account from posting on this board because it is an expired account. We assume you do have another paid account and you need to post with that particular account. This was the primary basis of blocking, but you are also posting way too many programming questions for us. We should not have to be answering these questions. All of this is very well documented.
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-12-15 23:25:10

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

Login

Login Page - Create Account