mathpaquette / IQFeed.CSharpApiClient

IQFeed.CSharpApiClient is fastest and the most well-designed C# DTN IQFeed socket API connector available
MIT License
120 stars 43 forks source link

HistoricalRequestFormatter HistoricalDataTimeFormat Incorrect #32

Closed hunterfries closed 5 years ago

hunterfries commented 5 years ago

HistoricalRequestFormatter HistoricalDataTimeFormat is currently hhmmss, but the IQ Feed api documentation states the format should be HHmmSS. This is causing any filter date past 12p to be invalid.

mathpaquette commented 5 years ago

@hunterfries please give me more details about the request you trying to do.

hunterfries commented 5 years ago

I'm trying to make a ReqHistoryIntervalTimeframeAsync request using beginFilterTime and endFilterTime. Note I did successfully use the filter function filtering between 930a and 10a.

lookupClient.Historical.ReqHistoryIntervalTimeframeAsync( symbol: dto.Symbol.Symbol, interval: ONE_MINUTE_IN_SECONDS, beginDate: dto.StartDateTime, endDate: endDateTime, beginFilterTime: new TimeSpan(9, 30, 0), endFilterTime: new TimeSpan(16, 0, 0));

jphiggs commented 5 years ago

Not sure if this is related to @hunterfries' issue but over the weekend I was getting an IQFeed exception when using the BasicHistorical Example for Historical.ReqHistoryIntervalDaysAsync. The inner exception was "Invalid number of parameters'. That didn't occur with the other 2 historical requests in step 5 for that example. The exception also does not occur if I hard code the IQFeed request to var request = $"HID,AAPL,300,5,100,,,,,,{IQFeedDefault.ProtocolTerminatingCharacters}"; in the historical request formatter. Bottom line is that the formatter will include 7 commas for the optional parameters in the request and that is correct according to the IQFeed documenation, but the exception occurs with seven commas and works with 6. There are also several of the ApiClient tests that are failing for historical requests.

mathpaquette commented 5 years ago

@jphiggs @hunterfries just ran all the tests and now everything seems to be fine. Can we suppose there was some instability during the weekend not related to the ApiClient?

jphiggs commented 5 years ago

I still get the 'Invalid number of parameters' exception in the BasicHistoricalExample for the lookupClient.Historical.ReqHistoryIntervalDaysAsync("AAPL", 300, 5, 100); request:

image

It works if I eliminate one of the optional parameters in the HistoricalRequestFormatter for an IntervalDays request

And still have failing tests for historical requests.
image

jphiggs commented 5 years ago

image

mathpaquette commented 5 years ago

@jphiggs just ran all the tests with IQFeed version 6.0.0.5 without any issue. What version you got?

mathpaquette commented 5 years ago

looks like a regression from IQFeed

jphiggs commented 5 years ago

Yep, still on 5.2.5.0 and I'll change that but thought the default ProtocolVersion = "5.2"; definition would have prevented a conflict. I'll get back with the result after I upgrade.

mathpaquette commented 5 years ago

Oh... of course you need to be in sync with the latest version of the Client... Just tested with the 6.0.1.1 and everything is green on my side.

image

mathpaquette commented 5 years ago

@jphiggs just tested your query and also works fine. Ill close the issue, reopen is you fine something new. Thanks guys.

jphiggs commented 5 years ago

Ok, that was it, thanks.