DTC Protocol Discussion Forum
- DTC Protocol Discussion Forum |
- Search Board |
- Control Panel |
- View My Posts / Threads |
- Direct Messages
Date/Time: Fri, 29 Nov 2024 16:27:29 +0000
Post From: Does SC historical connection support Google Protocol Buffers?
[2018-01-02 02:29:06] |
EricH - Posts: 18 |
To continue the Python/google protobuf and DTC experiments. Today's issue is on 'how do you specify the 'start/end date' for a historical data request. From the spec, both start/end time should of unix epoch time in sfixed64. So my question is what's the equivalent of sfixed64 in python? I tried the following: >>> message = Dtc.HistoricalPriceDataRequest() message.RequestID = 99 message.Symbol = "CRM" message.RecordInterval = Dtc.INTERVAL_1_MINUTE message.StartDateTime = 0 message.EndDateTime = long(1512000000) message.MaxDaysToReturn =int(30) message.UseZLibCompression = 0 >>> and send the request to SC. The EndDateTime, 1512000000 is 11/30/2017. SC log shows HD Server | Received login. Requesting authorization. | Username: EricHW. | 2018-01-02 10:15:14 HD Server | Login has been authorized. | Username: EricHW. | 2018-01-02 10:15:14 HD Server | HD Request #99 | Socket: 6986 | Symbol: CRM | ServiceCode: | RecordInterval: 60 | MaximumDaysRequested: 30 | Start date-time: Since beginning | ClientRequestID: 99 | Username: EricHW. | 2018-01-02 10:15:14 HD Server | HD Request # 99 | Socket: 6986 | Symbol: CRM | ServiceCode: | RecordInterval: 60 | Records Served: 17651 | ClientRequestID: 99 | Username: EricHW. | 2018-01-02 10:15:14 HD Server | Timed out waiting for client to close socket. | Username: EricHW. | 2018-01-02 10:16:14 From python debugger I can see roughly 60 days of records, 1st and last's timestamp decoded as time.struct_time(tm_year=2017, tm_mon=10, tm_mday=31, tm_hour=11, tm_min=27, tm_sec=5, tm_wday=1, tm_yday=304, tm_isdst=0) time.struct_time(tm_year=2017, tm_mon=12, tm_mday=29, tm_hour=22, tm_min=29, tm_sec=45, tm_wday=4, tm_yday=363, tm_isdst=0) So my questions are: 1. how do you specify the EndDate in this case? I've tried in python casting to int and long, or no casting, all with the same results. 2. From the log it seems SC does not properly decode the 'enddate' since there's no log message about it. 3. Why is 30-day request not respected? Date Time Of Last Edit: 2018-01-02 15:07:44
|