SmartQuant Discussion
http://www.smartquant.com/forums/

Is it possible to import data with Nanosecond precision?
http://www.smartquant.com/forums/viewtopic.php?f=86&t=14849
Page 1 of 1

Author:  azuric [ Tue Aug 07, 2018 4:17 pm ]
Post subject:  Is it possible to import data with Nanosecond precision?

Hi, I have data that is nanosecond timestamped, is it possible to import this?

I keep getting errors so assuming no.

Author:  skuvv [ Tue Aug 07, 2018 5:38 pm ]
Post subject:  Re: Is it possible to import data with Nanosecond precision?

Hello, try following pattern:

Input string:
123.22,2018.08.07 17:29:23.111222
Mask for datetime:
yyyy.MM.dd HH:mm:ss.ffffff

Attachment:
trade with ns.png
trade with ns.png [ 13.46 KiB | Viewed 1631 times ]


Check using strategy:

protected override void OnTrade(SmartQuant.Instrument instrument, SmartQuant.Trade trade)
{
Console.WriteLine(trade.DateTime.ToString("yyyy.MM.dd HH:mm:ss.ffffff"));
}

result:
2018.08.07 17:29:23.111222

Author:  azuric [ Tue Aug 07, 2018 7:04 pm ]
Post subject:  Re: Is it possible to import data with Nanosecond precision?

That's microsecond the best i can get to work is 100th of nanosecond.

Author:  skuvv [ Wed Aug 08, 2018 2:28 pm ]
Post subject:  Re: Is it possible to import data with Nanosecond precision?

You are right, 7 digits is limit of parsing.
In this case, the best way is to programmatically import with the analysis of the length of the digits after the point.
Selecting a substring with nanosecond part and adding it to datetime.

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/