Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 20:07:29 +0000



ACSIL and Millisecond Timestamps Question

View Count: 3363

[2013-07-03 11:16:53]
Sierra Chart Engineering - Posts: 104368

1. When I reference the tick chart from a higher level chart, can I reference the datetime array on the referenced chart? can I reference the ms data of the datetime array?

2. Does the following hold true for all bar chart types (time, volume, tick, range): if the timestamp of the tick bar is greater than or equal to the time stamp of the bar at index "Index", and the timestamp of the tick bar is less than the time stamp of the bar at index+1, then the tick "belongs" to the bar at index "Index".

3. Does the above depend on the datafeed and/or datafeed setting in anyway?

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
[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
[2013-07-04 07:59:13]
Sierra Chart Engineering - Posts: 104368
1. This code example has been updated to compare 2 Date-Time values to see if they match down to the millisecond level.

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
[2013-07-29 20:21:10]
onnb - Posts: 660
// Get the milliseconds for the current bar. Usually this will be 0. This is only an example of how to do it.

Not sure what is meant by "Usually this will be 0."
[2013-07-29 22:31:08]
Sierra Chart Engineering - Posts: 104368
Updated comment:
// Get the milliseconds for the current bar. This will be 0 if the chart bars are based upon a specific time by using the 'Days-Minutes-Seconds' Bar Period Type since the start time for a bar is always evenly aligned to a second based upon the Session Start Time and the time period of the bar. Otherwise, the milliseconds can be obtained for other Bar Period Types.

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-29 22:31:37
[2013-07-30 11:37:11]
Hendrixon - Posts: 130
1. From which SC version does this work?
2. The MS timestamp comes from the feed provider or is it printed by SC at local arrival time?
3. Rithmic data has MS resolution timestamp?
4. The "historical tick data" (back fill) from Optimus comes with MS timestamps?

This update is really appreciated.
[2013-07-30 21:00:22]
TastyRisk - Posts: 119
So can an accurate chart overlay be obtained with this new code ?

Example picture from v951 overlaying main chart data into region#2.
Date Time Of Last Edit: 2013-07-30 21:03:35
imageMILI.png / V - Attached On 2013-07-30 20:58:38 UTC - Size: 18.77 KB - 547 views

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account