Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 05:50:36 +0000



Post From: Perplexing Subgraph value error.

[2024-04-04 00:54:04]
Flipper_2 - Posts: 57
I am trying to track a variable in a subgraph but after hours of going around in circles I cannot resolve why a subgraph value cannot be set to a specific value.

That value is 20231211 but it always overflows to 20231212!! No matter how I code it see attached code. As you can see three subgraphs being set to 20231211 in the code but the subgraph value always has 20231212. Even -20231211 doesn't work.

Is this a bug??


SCSFExport scsf_TestSubgraph(SCStudyInterfaceRef sc)
{
  SCSubgraphRef DayNumber = sc.Subgraph[0];
  SCSubgraphRef SecondNumber = sc.Subgraph[1];
  SCSubgraphRef ThirdNumber = sc.Subgraph[2];

  if (sc.SetDefaults)
  {
    sc.GraphName = "Test";
    sc.AutoLoop = 1;

    DayNumber.Name = "Number";
    DayNumber.DrawStyle = DRAWSTYLE_IGNORE;
    DayNumber.PrimaryColor = RGB(0, 206, 206);

    SecondNumber.Name = "SecondNumber";
    SecondNumber.DrawStyle = DRAWSTYLE_IGNORE;
    SecondNumber.PrimaryColor = RGB(0, 206, 206);

    ThirdNumber.Name = "ThirdNumber";
    ThirdNumber.DrawStyle = DRAWSTYLE_IGNORE;
    ThirdNumber.PrimaryColor = RGB(0, 206, 206);

    return;
  }

  int testnumber = 20231211;

  DayNumber[sc.Index] = static_cast<float>(testnumber);

  SecondNumber[sc.Index] = 20231211.0;

  if (SecondNumber[sc.Index] != 20231211.0) {

    SCString BarDateTime = sc.DateTimeToString(sc.BaseDateTimeIn[sc.Index], FLAG_DT_COMPLETE_DATETIME);

    sc.AddMessageToLog(SCString().Format("%s - SecondNumber: %f", BarDateTime.GetChars(), SecondNumber[sc.Index]), 0);

  }

  ThirdNumber[sc.Index] = -20231211.0;

}

Have updated to latest version and tried on two different computers but still same result.
Date Time Of Last Edit: 2024-04-04 00:55:59
image2024-04-04 11_33_39-Small_indicators (Debugging) - Microsoft.png / V - Attached On 2024-04-04 00:42:48 UTC - Size: 155.18 KB - 66 views
image2024-04-04 11_27_09-NQM24-CME [C][M] 15 Min #2 - Chart Val.png / V - Attached On 2024-04-04 00:54:44 UTC - Size: 56.26 KB - 48 views