Login Page - Create Account

Support Board


Date/Time: Wed, 24 Apr 2024 05:31:24 +0000



Post From: ACSIL - Only three Subrahps are being displayed on Chart

[2019-07-12 12:46:51]
User722856 - Posts: 78
Dear Sirs,

I have programmed a simple study where i want to show four Lines (= Subgraphs) on my Chart.
Unfortunately always only three are displayed by Sierra.

--> sc.Subgraph[4] is not being plotted, why not?
Did i something wrong or is this a bug?

As far as i know (from the official documentation) 60 subgraphs are available.

Please find the code and screenshot bellow.

Thank you very much in advance.

/*============================================================================
This function demonstrates manual Subraph looping using a for loop.
----------------------------------------------------------------------------*/
SCSFExport scsf_ExampleSubgraph(SCStudyInterfaceRef sc)
{

  if (sc.SetDefaults)
  {
    // Set the configuration and defaults
    sc.GraphName = "Subgraph Example";

    sc.StudyDescription = "This is an example of using manual looping in Subgraph.";
    sc.AutoLoop = 0; // 0 is the default: there is no auto-looping
    sc.GraphRegion = 0; // Use the main price graph region (0 means Chart Region 1, 1 means Chart Region 2, maximum value can be 7=Region 8)


    sc.Subgraph[1].Name = "High-Min";
    sc.Subgraph[2].Name = "High-Max";

    sc.Subgraph[3].Name = "Low-Min";
    sc.Subgraph[4].Name = "Low-Max";


    return;
  }

  // Do data processing
  for (int Index = sc.UpdateStartIndex; Index < sc.ArraySize; Index++)
  {
    //================================================================================
    // Calculate the Upper Range (from Daily Low)
    //================================================================================
    // Calculate the Upper Range (from Daily Low) - High-Min:
    sc.Subgraph[1][Index] = sc.BaseData[SC_LOW][Index] + 20;
    // Calculate the Upper Range (from Daily Low) - High-Max:
    sc.Subgraph[2][Index] = sc.BaseData[SC_LOW][Index] + 40;


    //================================================================================
    // Calculate the Lower Range (from Daily High)
    //================================================================================
    // Calculate the Lower Range (from Daily High) - Low-Min:
    sc.Subgraph[3][Index] = sc.BaseData[SC_HIGH][Index] - 20;
    // Calculate the Lower Range (from Daily High) - Low-Max:
    sc.Subgraph[4][Index] = sc.BaseData[SC_HIGH][Index] - 40;
  }
}

Date Time Of Last Edit: 2019-07-12 13:00:19
imagesierra.png / V - Attached On 2019-07-12 12:44:49 UTC - Size: 25.19 KB - 230 views