IB Connector bug
Atom
8/30/2018
Chris Delaney


Hi,
I was just trying out the API latest version 4.4.13. Tried out both IQFeed and IB connectors. IQ Feed works great, but IB has a bug where my account # starts with a letter and it looks like you are trying to convert it to a number. Take a look at the exception attached.
This happens when I try to call portfolios.ForEach(Trader.RegisterPortfolio) right from your IB sample app in Mainwindow.xaml.cs.
If I comment out that line, the rest of it works fine.

Untitled.png 58 KB (387)

Tags:


Thanks: Support


Support

Avatar
Date: 8/30/2018
Reply


Please turn on Trader.LogLevel = Verbose and send us detailed logs to see what is happened.
Thanks:

Chris Delaney

Avatar
Date: 8/30/2018
Reply


Support
Please turn on Trader.LogLevel = Verbose and send us detailed logs to see what is happened.


I actually stepped through the code myself and identified the issue.
In InteractiveBrokersMessageAdapter_Transaction.cs class, in the ReadPortfolio(...) method, you handle a 'default' case if no other names match ("cashBalance, "Currency", etc), you are checking to see if currency.IsEmpty(), then if not, you assume the value must be a currency so you to create a Currency object with Value = value.To<decimal>(). However, that assumption is not going to be true for a number of attributes reported from IB.
This is all around line 600.
In my particular case, I had 2 fields that were being read from the socket with my Account # as the value, but my account # starts with a letter. So your code didn't match any of the fields in the case statement, so it assumed it must be currency and tried to convert to decimal and threw an exception. The takeaway is you can't assume it's a currency if no other names matched. In my case, there were at least 2 mismatched fields, one was named "AccountOrGroup".

I worked around the problem by commenting out that section of code. But I noticed that there are many other issues/bugs in the IB connector with regards to getting candlestick data. I'm getting exceptions where it's trying to convert numbers but it's getting strings.... maybe the message formats changed recently.
In any case, I'll try to get a log of that part.
Thanks:

Support

Avatar
Date: 8/30/2018
Reply


It seems you use out date source codes. We do not provide it for now already 3 years. Please use binary files what is much newer.
Thanks:


Attach files by dragging & dropping, , or pasting from the clipboard.

loading
clippy