Comments (12)
As I said it was probably IqFeed who sent the bad data. I do have requested tickers in my logs, but they receive good replies when being requested at the moment. I think it was something going on IqFeed side exactly at that moment (Jan 27, 5:35 PM EST), because the service continue to crash after automatic restart several times.
Nevertheless we must be somehow prepared for such situation (bad data from the vendor) and have an ability to handle it gracefuly. I am going to make a fix in a day or so, can file it as a PR.
from iqfeed.csharpapiclient.
@gribunin do you remember the ticker? Are you able to reproduce?
from iqfeed.csharpapiclient.
@gribunin absolutely this is bad data from the vendor. I dont want to change the types as already mention in another discussion. What are you suggesting ? Using TryParse instead like we do for streaming data? If it doesnt parse properly we need to be aware in other to drop the bad data.
from iqfeed.csharpapiclient.
I am suggesting to have a global try/catch in SocketClient.ProcessReceive, also add an event handler OnException to SocketClient, pass the caught exception object to this handler. Then subscribe to this event handler (OnException) in GetMessagesAsync and rethrow the exception passed to this handler there.
This way, the calls to lookupClient.Historical.GetHistoryTickDatapointsAsync and other API methods wrapped to try/catch will catch these exceptions.
from iqfeed.csharpapiclient.
I am suggesting to have a global try/catch in SocketClient.ProcessReceive, also add an event handler OnException to SocketClient, pass the caught exception object to this handler. Then subscribe to this event handler (OnException) in GetMessagesAsync and rethrow the exception passed to this handler there.
This way, the calls to lookupClient.Historical.GetHistoryTickDatapointsAsync and other API methods wrapped to try/catch will catch these exceptions.
not sure I like this solution. Maybe converting all Parse to TryParse makes more sense to me.
from iqfeed.csharpapiclient.
If convert Parse to TryParse what is going to be done when TryParse fails? The calling method will throw an exception?
from iqfeed.csharpapiclient.
If convert Parse to TryParse what is going to be done when TryParse fails? The calling method will throw an exception?
not at all.... TryParse doesnt throw.
from iqfeed.csharpapiclient.
@gribunin please., lets start with this first. create a PR converting double.Parse DateTime.ParseExact int.Parse
like we do in UpdateSummaryMessage
from iqfeed.csharpapiclient.
I see what you mean. Do you think its a correct approach to swallow bad data from iqfeed and just return zeros in the fields which couldnt be parsed? How will a client know that its not a correct TickMessage and that actually bad data has been received?
from iqfeed.csharpapiclient.
Added a pull request (#97) with my idea to catch exceptions and marshal them to the caller context. This way the caller can catch the situation when IqFeed returned bad data, handle this situation as the caller needs. The thrown exception also provides additional information about what exactly failed to be parsed as long as context information (request, received message -- same as in other IQFeedExceptions).
from iqfeed.csharpapiclient.
@gribunin I'm about to push a slightly enhanced version as well. I'll add you as a reviewer.
from iqfeed.csharpapiclient.
@gribunin please check my PR.
from iqfeed.csharpapiclient.
Related Issues (20)
- Support of new IqFeed version 6.2 HOT 2
- MarketSummary.GetEndOfDayFundamentalSummaryAsync throws Exception HOT 2
- getting stock symbol info (industry, sector etc) HOT 2
- Minute bars for various divisions of the trading day. HOT 2
- Enhancement - Add to items in enum DynamicFieldSet.cs HOT 1
- Enhancement? Dealing with Streaming Level2 HOT 3
- im trying to run with mono pythonnet HOT 5
- Examples HOT 5
- Streaming.Derivative
- startDate endDate HOT 6
- Save lookup data without the ENDMSG HOT 1
- The system cannot find the file specified Error HOT 4
- 1st timer 'ErrorMessage: Unauthorized user ID., MessageTrace: E,Unauthorized user ID., !ENDMSG!,' HOT 2
- how to pass retrieved data to a readable format HOT 3
- "The system cannot find the file specified" HOT 4
- - HOT 1
- IQFeed client causes webSite crash HOT 2
- How can I download Level 2 historical Tic data from yestereday?
- IQFeed API, MacOS & Python
- AskTime and BidTime give timespan that shows no date HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iqfeed.csharpapiclient.