Login Page - Create Account

Support Board


Date/Time: Thu, 15 May 2025 00:14:44 +0000



Post From: Using Data From Other Charts

[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