Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 07:53:06 +0000



[Programming Help] - Point & Figure Chart, sc.Index

View Count: 1056

[2017-03-15 18:56:42]
TerellDunn - Posts: 8
I'm getting varied results using sc.Index with a point and figure chart (not study).

When using a point and figure chart (not study), which bar does sc.Index correspond to?
Date Time Of Last Edit: 2017-03-15 19:03:39
[2017-03-15 20:28:03]
Sierra Chart Engineering - Posts: 104368
It corresponds to the Point and Figure chart bars.
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
[2017-03-15 21:03:38]
TerellDunn - Posts: 8
The statements below are my assumptions. Correct me if I am wrong.

With automatic looping enabled, sc.BaseData[SC_LAST][sc.Index] is the last (closing/ current) price of the right most visible bar on the chart. This particular bar, let's call it "green bar 1", would still be in the process of updating to new data.

Once the price has reached the reversal size I specified, a new bar is formed, let's call it "red bar 1".

Now, to access the high price of "green bar 1", I would use sc.BaseData[SC_HIGH][sc.Index - 1].
[2017-03-15 21:15:53]
Sierra Chart Engineering - Posts: 104368
To consistently access the last bar in the chart you need to use:
sc.BaseData[SC_LAST][sc.ArraySize -1]

The prior bar will be:
sc.BaseData[SC_LAST][sc.ArraySize -2]

Refer to:
Working with ACSIL Arrays and Understanding Looping
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: 2017-03-15 21:16:11
[2017-03-17 04:45:38]
TerellDunn - Posts: 8
That seems to have solved the problem. Thanks for the help.

Every example listed under the hyperlink given is using sc.Index and sc.Index - 1 however.

Why isn't sc.Index consistent?
[2017-03-17 04:59:20]
Sierra Chart Engineering - Posts: 104368
The examples given are correct relative to what they are intending to explain.

We do not understand this question:
Why isn't sc.Index consistent?

The question indicates, that you have a misunderstanding about that variable. Refer to:
Working with ACSIL Arrays and Understanding Looping
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
[2017-03-17 05:31:30]
TerellDunn - Posts: 8
Your previous post said to consistently access the last bar in the chart, I should use sc.ArraySize - 1 which prompted me to ask why sc.Index was not consistently accessing the last bar.
[2017-03-20 07:07:30]
Sierra Chart Engineering - Posts: 104368
One case would be when there is a new bar added to the chart, sc.Index will be at the index prior to the new bar and then the study function is called again, and it will equal the index of the new bar.
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: 2017-03-20 08:04:41

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

Login

Login Page - Create Account