Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 11:06:56 +0000



Post From: sc.ArraySize and sc.Index not updating simultaneously

[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