Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 19:55:17 +0000



Post From: ACSIL and Millisecond Timestamps Question

[2013-07-03 22:57:09]
Sierra Chart Engineering - Posts: 104368
The reason for the delay, is we had to do some code review to make sure the millisecond class was working as expected. We also had to prepare a code example.

1. Yes. Here is a complete code example:


SCSFExport scsf_MillisecondsExample(SCStudyInterfaceRef sc)
{
  if (sc.SetDefaults)
  {
    // Set the configuration and defaults

    sc.GraphName = "Milliseconds Example";

    sc.AutoLoop = 1;

    sc.FreeDLL = 0;

    return;
  }
  //When working with milliseconds it is necessary to define variables of type SCDateTimeMS
  SCDateTimeMS DateTimeMS , DateTimeMSRefChart;

  // Get the milliseconds for the current bar. Usually this will be 0. This is only an example of how to do it.
  DateTimeMS = sc.BaseDateTimeIn[sc.Index];
  int MilliSecond = DateTimeMS.GetMilliSecond();


  //Get the Date-Times from another chart.
  SCDateTimeArray RefChartDateTime;
  sc.GetChartDateTimeArray(2, RefChartDateTime );

  if(RefChartDateTime.GetArraySize() != 0)
  {
    //Get milliseconds for last bar in the other chart being referenced
    DateTimeMSRefChart = RefChartDateTime[RefChartDateTime.GetArraySize() - 1];
    int MilliSecond = DateTimeMSRefChart.GetMilliSecond();

  }


  //Compare the Date-Times from the 2 charts with millisecond precision
  if(DateTimeMS ==DateTimeMSRefChart)
  {
    //There is a match down to the millisecond
  }

}



2. Yes. But to use millisecond precision requires the use of the SCDateTimeMS type.

3. This does depend upon having tick by tick data in the data file. So the Intraday Data Storage Time Unit must be 1 Tick.

There can be an issue with historical tick data downloaded from services like IQ Feed but we will solve that. This will be done in the next release.

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2013-07-04 07:59:32