Login Page - Create Account

Support Board


Date/Time: Tue, 07 May 2024 23:46:52 +0000



Post From: HOWTO Convert Time To Seconds ?

[2022-12-31 18:56:22]
TriStar Trading - Posts: 113
Here is how I did it.

  //Set the configuration variables and defaults.
  SCSubgraphRef BarSeconds  = sc.Subgraph[0];

if (sc.SetDefaults)
{
//Set the configuration and defaults
sc.GraphName = "Bar Duration In Seconds;
  sc.GraphRegion = 1;  //Not Main graph region
sc.AutoLoop = 1;
  sc.ValueFormat = 0;
    
  //Define the Subgraphs
  BarSeconds.Name = "Bar Seconds";
  BarSeconds.DrawStyle = DRAWSTYLE_BAR;
  BarSeconds.LineWidth = 2;
  BarSeconds.PrimaryColor = RGB(128,128,128);
    
  return;
}

  SCDateTimeMS BarEndDateTime = sc.GetEndingDateTimeForBarIndex(sc.Index);
  SCDateTimeMS ElapsedTime = static_cast<float>((BarEndDateTime - sc.BaseDateTimeIn[sc.Index] + SCDateTime::MICROSECONDS(1)).GetAsDouble());

  BarSeconds[sc.Index] = ElapsedTime.GetTimeInSeconds();