Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 17:42:03 +0000



ACSIL interface member that will return index value of latest datum displayed

View Count: 841

[2019-04-15 16:21:37]
jsob - Posts: 33
I've developed a study the purpose of which is to display a plot for the latest 'x' number of values displayed on my chart. As I scroll back through historic data, I want my study to be updated to continue reflecting a plot for the then current latest 'x' values displayed. Is there a function available that will return the index value of the latest datum currently displayed in my plot? Thank you.
[2019-04-15 18:29:39]
Sierra Chart Engineering - Posts: 104368
Refer to the following variable:
ACSIL Interface Members - Variables and Arrays: sc.IndexOfLastVisibleBar
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
[2019-04-15 19:23:58]
jsob - Posts: 33
Can't get it to work the way I need.
<snippet>
if (sc.SetDefaults)
{
sc.UpdateAlways = 1;
....
return
}
int i_start_value = sc.IndexOfLastVisibleBar - number_of_values.GetInt();    // "plot # of values:"
<end snippet>
As I scroll my chart backward, the value of 'i_start_value' does not change.
If I navigate to the Chart Studies window and hit Apply, the value will update.
[2019-04-16 01:27:16]
jsob - Posts: 33
May I have a response? I cannot get the example cited in your link to work:
float Value = sc.BaseData[SC_LAST][sc.IndexOfLastVisibleBar];
When I do a "Page Scroll Left", values associated with sc.IndexOfLastVisibleBar and sc.IndexOfFirstVisibleBar are not updated to reflect the new chart display.
Am I using these members incorrectly?
[2019-04-16 04:59:39]
Sierra Chart Engineering - Posts: 104368
We do know those ACSIL structure members do update as the chart is scrolled but of course the study function has to be called which occurs at the chart update interval. It does not occur at every moment the chart is scrolled. This was tested about a week ago.

Refer to this thread:
sc.IndexOfFirstVisibleBar not updating with sc.UpdateAlways = 1;

What is the chart update interval you are using:
General Settings Window: Chart Update Interval (Global Settings >> General Settings >> General >> Update Intervals)
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: 2019-04-16 05:00:29

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

Login

Login Page - Create Account