Login Page - Create Account

Support Board


Date/Time: Thu, 16 May 2024 10:33:53 +0000



Millisecond part of SCDateTimeMS variable

View Count: 2010

[2014-07-15 05:02:41]
User44130 - Posts: 23
I'm trying to get time with milliseconds for records in Time&Sales array using code below but millisecond part of time variable does not print to the log.
Please advise how to output millisecond part of SCDateTimeMS variable to log.
Is there a function to extract millisecond part of SCDateTimeMS variable as integer in order to use it in calculations?

  SCDateTimeMS TSADateTime;
  SCString MsgLog;

  sc.GetTimeAndSales(TSA);
  int TSArrSize = TSA.GetArraySize() - 1;
  for (t = TSArrSize; t >= 0; t--)
  {
    TSADateTime = TSA[t].DateTime;
    TSADateTime += sc.TimeScaleAdjustment;

    MsgLog.Format(" TSADateTime: %s ", sc.FormatDateTime(TSADateTime).GetChars());
    sc.AddMessageToLog(MsgLog,0);
}


[2014-07-22 06:15:37]
Sierra Chart Engineering - Posts: 104368
sc.FormatDateTime will not show the milliseconds.

You can get the milliseconds. Refer to the documentation here for this:
https://www.sierrachart.com/index.php?page=doc/doc_ACSILProgrammingConcepts.html#AccessingMilliseconds
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
[2014-09-10 03:11:48]
User44130 - Posts: 23
Still no success in getting millisecond part. Using the following code:

  int year,month,day;
  int hour, minute, second, millisecond;

  SCDateTimeMS TSADateTime = TSA[t].DateTime;
  TSADateTime += sc.TimeScaleAdjustment;
  TSADateTime.GetDateTimeYMDHMS_MS( year, month, day, hour, minute, second, millisecond);

  MsgLog.Format(" %d-%d-%d %d:%d:%d.%d ", year, month, day, hour, minute, second, millisecond);
  sc.AddMessageToLog(MsgLog,0);

Date & Time is OK but millisecond number is 0 although IQFeed Watch Quote tool clearly shows milliseconds.

When I started using SCDateTimeMS variable in the code Message Log printed error: "IQFeed Level 2 error: Account not authorized for Level II | 2014-09-09 20:57:12". Is this somehow related? Do I need Level 2 authorization just to receive millisecond part? See below full text...



Software version: 1187 | 2014-09-09 20:56:56
Usage end date: 2015-04-10 | 2014-09-09 20:56:57
Enabled for: Advanced Features. | 2014-09-09 20:56:57
Enabled for: Sierra Chart Historical Data Service. | 2014-09-09 20:56:57
Allow Support for Sierra Chart Data Feeds is enabled. | 2014-09-09 20:56:57
Active service: IQFeed | 2014-09-09 20:56:57
Time Zone: -06:00:00 (MST-07MDT+01,M3.2.0/02:00,M11.1.0/02:00) | 2014-09-09 20:56:57
2014-09-09 20:56:57 Local computer clock time | 2014-09-09 20:56:57
2014-09-10 02:56:57 GMT time | 2014-09-09 20:56:57
2014-09-09 20:56:57 Time zone adjusted time | 2014-09-09 20:56:57
Time difference to server time: 0 seconds. | 2014-09-09 20:56:57
Program path: C:\SierraChart\ | 2014-09-09 20:56:57
Data Files path: C:\SierraChart\Data\ | 2014-09-09 20:56:57
OS Version Number: 6.1 | 2014-09-09 20:56:57

Checking for new symbol settings for dtn | 2014-09-09 20:56:57
HTTP connection to www.sierrachart.com:80 (0) | Resolved address sierrachart.com to IP 188.40.121.148 | 2014-09-09 20:56:57
HTTP connection to www.sierrachart.com:80 (1416) | Connected. | 2014-09-09 20:56:57
Symbol settings are up-to-date for dtn | 2014-09-09 20:56:57
HTTP connection to www.sierrachart.com:80 (1416) | Closed. No error. | 2014-09-09 20:57:07
HTTP connection to www.sierrachart.com:80 (1416) | Shutdown and closed. | 2014-09-09 20:57:07

IQFeed | Connecting. | 2014-09-09 20:57:10
Starting DTN IQ Feed interface software. | 2014-09-09 20:57:10
IQFeed | Connecting to Admin port 9300 | 2014-09-09 20:57:10
Socket (2096) | Connected. | 2014-09-09 20:57:10
IQFeed | Connected to Admin port. | 2014-09-09 20:57:10
AdminMessage: S,REGISTER CLIENT APP COMPLETED, | 2014-09-09 20:57:10
AdminMessage: S,STATS,66.112.156.110,60002,500,1,3,0,0,0,Sep 09 10:10PM,Sep 09 10:57PM,Connected,5.1.1.3,413409,184.15,0.02,0.07,3627.28,0.60,1.29, | 2014-09-09 20:57:10
IQFeed | Connecting to Level 1 port 5009 | 2014-09-09 20:57:10
Socket (2100) | Connected. | 2014-09-09 20:57:10
IQFeed | Connected to Level 1 port. | 2014-09-09 20:57:10
IQFeed | Connecting to Lookup port 9100 | 2014-09-09 20:57:10
IQFeed | Connecting to Level 2 port (9200)... | 2014-09-09 20:57:10
Socket (1416) | Connected. | 2014-09-09 20:57:10
IQFeed | Connected to Historical Data port. | 2014-09-09 20:57:10
IQFeed | Fully connected. | 2014-09-09 20:57:10
Socket (1424) | Connected. | 2014-09-09 20:57:10
IQFeed | Connected to Level 2 port. | 2014-09-09 20:57:10
IQFeed Level 2 error: Account not authorized for Level II | 2014-09-09 20:57:10
IQFeed | Level 1 system message: KEY | 2014-09-09 20:57:10
IQFeed | Level 1 system message: SERVER CONNECTED | 2014-09-09 20:57:10
IQFeed | Level 1 system message: IP | 2014-09-09 20:57:10
IQFeed | Level 1 system message: CUST | 2014-09-09 20:57:10
IQFeed | Level 2 protocol is 5.0. | 2014-09-09 20:57:10
IQFeed | Starting real-time market data updates for: @ESU14. ID: 1 | 2014-09-09 20:57:10
Intraday data recording state for symbol @ESU14 is set to pending. | 2014-09-09 20:57:10
HD Request # 2 | Downloading Intraday chart data for @ESU14 to the file @ESU14.scid. Service: dtn | 2014-09-09 20:57:10
HD Request # 2 | Download start Date-Time: 2014-09-09 20:56:00.0 | 2014-09-09 20:57:10
HD Request # 2 | Requesting Minute data beginning at 2014-09-09 22:56:00 US Eastern Time. | 2014-09-09 20:57:10
HD Request # 2 | Receiving Intraday Minute data for @ESU14 | 2014-09-09 20:57:11
HD Request # 2 | Receiving Intraday data for @ESU14 starting at 2014-09-09 20:56:00 | 2014-09-09 20:57:11
HD Request # 2 | Timestamp of first Intraday data file record written: 2014-09-09 20:56:00 | 2014-09-09 20:57:11
HD Request # 2 | Received 1 record from 2014-09-09 20:56:00 to 2014-09-09 20:56:00 (0.0 seconds) and wrote 1 record for @ESU14 | 2014-09-09 20:57:11
HD Request # 2 | Intraday download COMPLETE for @ESU14. Completion time: 1s | 2014-09-09 20:57:11
Real-time Intraday chart data file updates started for @ESU14 | 2014-09-09 20:57:11

Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 millisecond: 0 BarDT: 2014-09-09 20:56:00 TID: 1 i: 7527 P: 1987.250000 V: 1 A: 1987.250000 AS: 79 B: 1987.000000 BS: 61 TP: 6 QSVABS: 0 QASVar: 0 QBSVar: 0 ABVABS: 0 AVVar: 0 BVVar: 0 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 2014-9-9 20:57:11.0 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 millisecond: 0 BarDT: 2014-09-09 20:56:00 TID: 2 i: 7527 P: 1987.250000 V: 1 A: 1987.250000 AS: 79 B: 1987.000000 BS: 63 TP: 6 QSVABS: 2 QASVar: 0 QBSVar: 2 ABVABS: 0 AVVar: 0 BVVar: 0 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 2014-9-9 20:57:11.0 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 millisecond: 0 BarDT: 2014-09-09 20:56:00 TID: 3 i: 7527 P: 1987.000000 V: 1 A: 1987.250000 AS: 79 B: 1987.000000 BS: 63 TP: 1 QSVABS: 2 QASVar: 0 QBSVar: 2 ABVABS: -1 AVVar: 0 BVVar: 1 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 2014-9-9 20:57:11.0 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 millisecond: 0 BarDT: 2014-09-09 20:56:00 TID: 4 i: 7527 P: 1987.000000 V: 1 A: 1987.250000 AS: 79 B: 1987.000000 BS: 62 TP: 6 QSVABS: 1 QASVar: 0 QBSVar: 1 ABVABS: -1 AVVar: 0 BVVar: 1 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 2014-9-9 20:57:11.0 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 millisecond: 0 BarDT: 2014-09-09 20:56:00 TID: 5 i: 7527 P: 1987.000000 V: 1 A: 1987.250000 AS: 79 B: 1987.000000 BS: 60 TP: 6 QSVABS: -1 QASVar: 0 QBSVar: -1 ABVABS: -1 AVVar: 0 BVVar: 1 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 2014-9-9 20:57:11.0 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 millisecond: 0 BarDT: 2014-09-09 20:56:00 TID: 6 i: 7527 P: 1987.000000 V: 1 A: 1987.250000 AS: 79 B: 1987.000000 BS: 58 TP: 6 QSVABS: -3 QASVar: 0 QBSVar: -3 ABVABS: -1 AVVar: 0 BVVar: 1 | 2014-09-09 20:57:11
Chart: @ESU14 1 Min #1 | Study: TickProcLog | TM: 2014-09-09 20:57:11 2014-9-9 20:57:11.0 | 2014-09-09 20:57:11
IQFeed Level 2 error: Account not authorized for Level II | 2014-09-09 20:57:12


[2014-09-10 05:01:43]
Sierra Chart Engineering - Posts: 104368
You will not see any milliseconds on 1 minute data.
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
[2014-09-10 13:54:07]
User44130 - Posts: 23
Yes, base chart is 1 minute but it does not matter because the study behind it processes every tick of data from Time & Sales array and outputs it to message log. Each record above is one tick data with timestamp (TM:) and unique SC Tick ID (TID:) so milliseconds should be there. The problem is SC replaces original IQFeed milliseconds number by artificial consecutive digit so timestamps for every tick look like this:

IQFeed SC
20:57:11.359 20:57:11.0
20:57:11.495 20:57:11.1
20:57:11.882 20:57:11.2

This was discussed in this post: https://www.sierrachart.com/supportboard/showthread.php?t=42371

You wrote: "We will be using the actual IQ feed timestamps and they will override the Sierra Chart incremental millisecond timestamp." But that is not happening.

[2014-09-10 16:16:14]
Sierra Chart Engineering - Posts: 104368

You wrote: "We will be using the actual IQ feed timestamps and they will override the Sierra Chart incremental millisecond timestamp." But that is not happening.

This is not the case. We are not using the data feed milliseconds.
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
[2014-09-10 16:35:14]
User44130 - Posts: 23
So there's no way I can have access to authentic timestamp milliseconds information via SC code?
[2014-09-11 04:57:12]
Sierra Chart Engineering - Posts: 104368
Not now. We have looked at this possibility, but it is just something that requires so much detailed analysis to implement correctly, that we have deferred it.
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
[2014-09-11 09:03:22]
Hendrixon - Posts: 130
Dear SC,
Please give it another go, you simply have no idea how important it is to the security of us traders...
Seriously if a more inferior platform like Multicharts support Microseconds (yes micro!), than you guys can't find the way to support Milliseconds?

* At least, for the mean time, give us ACSIL coders an SC member (something like "sc.DatafeedDateTimeOfLastTrade") that gives the feed's timestamp down to the millisecond of the last tick/trade.


Thanks.
Date Time Of Last Edit: 2014-09-11 09:14:07

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

Login

Login Page - Create Account