Support Board
Date/Time: Sat, 30 Nov 2024 02:35:28 +0000
Post From: HOWTO Convert Time To Seconds ?
[2022-12-31 18:56:22] |
TriStar Trading - Posts: 142 |
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(); |