Login Page - Create Account

Support Board


Date/Time: Mon, 22 Apr 2019 07:03:47 +0000



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

Support Request:
[2019-04-15 16:21:37]
jsob - Posts: 25
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: 71060
Refer to the following variable:
https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Variables_And_Arrays.html#scIndexOfLastVisibleBar
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
[2019-04-15 19:23:58]
jsob - Posts: 25
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: 25
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: 71060
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:
https://www.sierrachart.com/SupportBoard.php?ThreadID=41660

What is the chart update interval you are using:
https://www.sierrachart.com/index.php?page=doc/GeneralSettings.html#ChartUpdateInterval
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.
Date Time Of Last Edit: 2019-04-16 05:00:29

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

Login


Login Page - Create Account