mathpaquette / IB.CSharpApiClient

Interactive Brokers - TWS API simplified client
MIT License
57 stars 17 forks source link

IbClient.Response.HistoricalDataAsync() only firing once. keepUpToDate option missing. #10

Closed valeryjacobs closed 3 years ago

valeryjacobs commented 3 years ago

When calling ReqHistoricalData like this:

ibClient.Request.ReqHistoricalData(tickerId, contract, "", durationString, barSizeString, "TRADES", 0, 1, new List<TagValue>());

One would expect the HistoricalDataAsync() response to fire until it delivered the last candle in the range.

while (true) { var historicalDataMsg = await ibClient.Response.HistoricalDataAsync();

The IB API documentation mentions the keepUpToDate parameter to continue delivering new bars, this option isn't available in this API.

Thanks for providing us this library, this is really useful. Hopefully the historical data feed can be fixed, or I can learn what I'm doing wrong. Cheers!

mathpaquette commented 3 years ago

I'll have a look and let you know

valeryjacobs commented 3 years ago

Could it be that there is a response missing for historicalDataUpdate? When I use the IB provided client directly this is the method (I think) that continues providing bars. Not sure if that only happens with the keepUpToDate flag or not, will continue to investigate.

mathpaquette commented 3 years ago

@valeryjacobs could you provide the steps to reproduce. Im happy to investigate with you. Please provide a PR link with your app.

valeryjacobs commented 3 years ago

Please disregard all of the above. I was working in the wrong namespaces of IB's client library instead of yours. I copied some code from a sample elsewhere that I thought was based on your client. Maybe a sample application can be helpful for others when they want to give it a spin.

mathpaquette commented 3 years ago

Please disregard all of the above. I was working in the wrong namespaces of IB's client library instead of yours. I copied some code from a sample elsewhere that I thought was based on your client. Maybe a sample application can be helpful for others when they want to give it a spin.

Yes I agree! Let me create an issue for this. Thanks for your comment !