mathpaquette / IQFeed.CSharpApiClient

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

MarketSummary.GetEndOfDayFundamentalSummaryAsync throws Exception #134

Closed Rob-Hague closed 2 years ago

Rob-Hague commented 2 years ago

If I call

await lookupClient.MarketSummary.GetEndOfDayFundamentalSummaryAsync(Lookup.Symbol.SecurityType.FOPTION, 34, DateTime.Today)

there is an exception raised in MarketSummaryMessage due to headings looking like LM,Symbol,Description,PeRatio,AvgVolume,DivYield,DivAmount,DivRate,PayDate,ExDivDate,CurrentEps,EstEps,SIC,Precision,Display,GrowthPercent,FiscalYearEnd,Volatility,ListedMarket,MaturityDate,OptionRoots,CouponRate,InstitutionalPercent,YearEndClose,Beta,LEAPs,WRAPs,Assets,Liabilities,BalanceSheetDate,LongTermDebt,CommonSharesOutstanding,MarketCap,52WeekHigh,52WeekHighDate,52WeekLow,52WeekLowDate,CalHigh,CalHighDate,CalLow,CalLowDate,Expiration,LastSplit,LastSplitDate,PrevSplit,PrevSplitDate,NAICS,ShortInterest (on 6.2, 6.1 looks the same but without the LM,)

which don't match MarketSummaryDynamicFieldset. Note that the test Should_Return_MarketSummaryMessages_When_GetFundamentalSummaryAsync does not fail because of a typo which calls GetEndOfDaySummaryAsync instead of GetEndOfDayFundamentalSummaryAsync

My understanding is that the market summary messages are somewhat dynamic. For my purposes I am happy with the raw version as a file so I have added a MarketSummaryFileFacade which follows the logic of the HistoricalFileFacade. I can open a PR to add this (and which fixes the test typo but does not make the test pass)

mathpaquette commented 2 years ago

Definitely PRs are welcomed. Did you check with protocol 6.2 and branch https://github.com/mathpaquette/IQFeed.CSharpApiClient/tree/protocol_6.2

?

Rob-Hague commented 2 years ago

Yes I saw the same behaviour on master with protocol 6.1 and 6.2, and also on the protocol_6.2 branch. I opened PR #135 to fix the typo in the test and add MarketSummaryFileFacade