Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 20:02:51 +0000



SCGraphData clarification:

View Count: 1712

[2013-08-01 18:52:06]
golding - Posts: 18
SC,

In the example below, I find a difference between:

int endRefChartNdex = graphData.GetArraySize() - 1 ;
int endRefChartNdex = graphData[0].GetArraySize() - 1 ;

The former returns the same static results for each call to the PROCESS_AGENT_SIGNALS2, while the latter returns variable results (the desired behavior).

I used the former at first since the code loops thru all subgraphs in SCGraphData , so I expect the index to be consistent for all SGs.

The documentation for sc.GetStudyArraysFromChart shows use of both, first to test the SCGraphData size, then to test the SG size.

Shouldn't GetArraySize return the same result for both? Am I missing something or is this unexpected behavior?

thx
JG

==============================

Example:

inline void PROCESS_AGENT_SIGNALS2( SCStudyInterfaceRef sc, int chartNum, SCGraphData &graphData, int mode, int bgColor )
{
  int endRefChartNdex = graphData[0].GetArraySize() - 1 ;

  for ( int sgNdex = 1 ; sgNdex < NUM_SIG_CNTRL_SGS ; sgNdex++ )
  {
      sc.Subgraph[sgNdex][sc.Index] = graphData[sgNdex][endRefChartNdex] ;

======================

Documentation for sc.GetStudyArraysFromChart has the following example:

SCGraphData StudyData;
sc.GetStudyArraysFromChart(ChartNumber, 1, StudyData);

// Check if we got the data and then get the first subgraph array from the study data

if(StudyData.GetArraySize() == 0)
return;

SCFloatArrayRef StudyArray = StudyData[0];

if(StudyArray.GetArraySize() == 0)

return;
[2013-08-02 11:31:07]
Sierra Chart Engineering - Posts: 104368
This gets the number of Subgraph arrays. If the Arrays were returned, then this will be 60:
graphData.GetArraySize()

This gets the number of elements within a particular Subgraph:

graphData[0].GetArraySize()

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: 2013-08-02 11:31:48

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

Login

Login Page - Create Account