Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 19:38:13 +0000



Post From: Contradictory Documentation for sc.UpdateStartIndex

[2023-07-17 04:46:09]
User208107 - Posts: 13
#1:
During normal chart updating sc.UpdateStartIndex will always be equal to the last index of the prior sc.ArraySize before the chart update.
(https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Variables_And_Arrays.html#scUpdateStartIndex:~:text=During%20normal%20chart%20updating%20sc.UpdateStartIndex%20will%20always%20be%20equal%20to%20the%20last%20index%20of%20the%20prior%20sc.ArraySize%20before%20the%20chart%20update.)

#2:
The call into the study function will just be an update call with [sc.UpdateStartIndex] set to the prior array size.
(https://www.sierrachart.com/index.php?page=doc/ACS_ArraysAndLooping.html#WhenTheStudyFunctionIsCalled:~:text=The%20call%20into%20the%20study%20function%20will%20just%20be%20an%20update%20call%20with%20sc.Index/sc.UpdateStartIndex%20set%20to%20the%20prior%20array%20size.)

If there is a chart update without a new bar, according to #1, sc.UpdateStartIndex = sc.ArraySize - 1; according to #2, sc.UpdateStartIndex = sc.ArraySize. If there is a chart update with a new bar, according to #1, sc.UpdateStartIndex = sc.ArraySize - 2; according to #2, sc.UpdateStartIndex = sc.ArraySize - 1.