Login Page - Create Account

Support Board


Date/Time: Wed, 08 May 2024 06:25:24 +0000



the possibility of two consecutive manual looping

View Count: 625

[2018-12-26 01:53:51]
Andy Sureway - Posts: 93
Hello SC staff,

I am working on an indicator which uses two passes of manual looping (from sc.UpdateStartIndex to sc.ArraySize). It seems that ACSIL has some format restraint, which disallow this to happen.

To make it clearer, what I want is:

for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++) {
// pass 1
}
for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++) {
// pass 2
}

I have done several tests. It seems impossible to even add two or more additional statements after the first manual looping.

I know how to bypass this format constraint, as seen below. But just want to confirm whether my understanding is correct.

for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++) {
// pass 1
if(BarIndex == sc.ArraySize-1)
for (int BarIndex2 = sc.UpdateStartIndex; BarIndex2 < sc.ArraySize; BarIndex2++) {
// pass 2
}
}

Thanks a lot!
Date Time Of Last Edit: 2018-12-26 01:54:56
[2018-12-26 03:15:21]
Sierra Chart Engineering - Posts: 104368
It should be obvious that this will work just fine:
for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++) {

// pass 1

}

for (int BarIndex = sc.UpdateStartIndex; BarIndex < sc.ArraySize; BarIndex++) {

// pass 2

}
This has nothing to do with ACSIL. This is nothing more than C++ code. You can do what you want and this is just fine.
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-26 03:15:52

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

Login

Login Page - Create Account