Login Page - Create Account

Support Board


Date/Time: Fri, 27 Dec 2024 01:29:59 +0000



Using Data From Other Charts

View Count: 1074

[2016-03-24 08:56:22]
User786661 - Posts: 5
I am trying to access the first subgraph Bar Numbering on the 2nd chart in the chart book.
SCFloatArray Bars;
sc.GetStudyArrayFromChart(2, 1, 0, Bars);
However the array Bars ends up empty instead of having the bar count so I'm wondering what I am doing wrong?

Thanks
[2016-03-24 17:39:38]
Sierra Chart Engineering - Posts: 104368
You really should use this Study Input to control all of the parameters properly:

https://www.sierrachart.com/index.php?page=doc/doc_ACSIL_Members_scInputs.html#scInputGetChartStudySubgraphValues
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
[2016-03-31 06:14:22]
User786661 - Posts: 5
I have copied the example in the link into my code so it now looks like this:

SCInputRef StudySubgraphReference = sc.Input[0];
  if (sc.SetDefaults)
  {
    sc.GraphName = "Automated VWAP Trader";
    sc.FreeDLL = 1;
    sc.AutoLoop = 1;
    sc.AllowMultipleEntriesInSameDirection = 0;
    sc.CalculationPrecedence = LOW_PREC_LEVEL;
    StudySubgraphReference.Name = "Study And Subgraph To Display";
    StudySubgraphReference.SetChartStudySubgraphValues(2, 1, 0);
    return;
  }

SCFloatArray StudyReference;
  sc.GetStudyArrayFromChartUsingID(StudySubgraphReference.GetChartStudySubgraphValues(), StudyReference);

But the StudyReference array is still empty and on the chart itself it shows: "Name of my study" (#0.ID0.SG1) which I believe means it is referencing the chart at #0, the study at 0 and the subgraph of that study at 1 but in the code above I am trying to set it up to reference the chart at #2 the study at 1 and the subgraph of that study at 0.

I am wondering where my mistake is in my code.

Thanks
[2016-03-31 10:26:21]
Sierra Chart Engineering - Posts: 104368
Go to the Study Inputs for this study. How do you have the 3 controls set for the "Study And Subgraph To Display" Input?

Could you attach a screenshot.
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
[2016-03-31 17:55:20]
User786661 - Posts: 5
The Input Values were incorrectly set so I've changed them to the correct values you see in the picture (Note: The chart I am attempting to reference has changed over night from #2 to #1).

In the bottom right my message log is showing that the array receiving the subgraph data is no longer empty. It holds 2954 elements, my main chart's current index is 27364, the "nearest index" (found with sc.GetNearestMatchForDateTimeIndex(1, sc.Index) was 2953 which all appears to be correct however all the values in the array appear to be 0.
Date Time Of Last Edit: 2016-04-07 23:40:49
imageScreenShot.png / V - Attached On 2016-03-31 17:49:27 UTC - Size: 118.85 KB - 269 views
[2016-04-07 23:39:54]
User786661 - Posts: 5
Bump
Date Time Of Last Edit: 2016-04-07 23:40:34
[2016-04-08 01:00:37]
Sierra Chart Engineering - Posts: 104368
We do not provide programming help.
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
[2016-04-08 01:02:13]
Sierra Chart Engineering - Posts: 104368
Although we did check to make sure that the Bar Numbering study does fill Subgraph at index 0 with the bar number values.
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
[2016-04-08 01:04:05]
Sierra Chart Engineering - Posts: 104368
Another thing to consider is study calculation precedence/order:
https://www.sierrachart.com/index.php?page=doc/doc_ChartStudies.html#StudyCalculationPrecedence
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

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

Login

Login Page - Create Account