Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Decoder error #235

Closed
isak-r opened this issue Apr 13, 2020 · 1 comment
Closed

Decoder error #235

isak-r opened this issue Apr 13, 2020 · 1 comment

Comments

@isak-r
Copy link

isak-r commented Apr 13, 2020

Getting this error on start up

Ib_insync: 0.9.59
TWS: 978.1o

Error handling fields: ['5', '353', '265598', 'AAPL', 'STK', '', '0', '?', '', 'SMART', 'USD', 'AAPL', 'NMS', 'SELL', '112', 'LMT', '1000.1', '0.0', 'DAY', '', 'DU996211', 'O', '0', '', '100', '828086885', '0', '0', '0.67', '', '828086885.0/DU996211/100', '', '', '', '', '', '', '', '', '', '0', '', '-1', '0', '', '', '', '', '', '', '0', '0', '0', '', '3', '1', '1', '', '0', '0', '', '0', 'None', '', '0', '', '', '', '?', '0', '0', '', '0', '0', '', '', '', '', '', '0', '0', '0', '', '', '', '', '0', '', 'IB', '0', '0', '', '0', '0', 'Submitted', '1.7976931348623157E308', '1.7976931348623157E308', '1.7976931348623157E308', '1.7976931348623157E308', '1.7976931348623157E308', '1.7976931348623157E308', '1.7976931348623157E308', '1.7976931348623157E308', '1.7976931348623157E308', '', '', '', '', '', '0', '0', '0', 'None', '1.7976931348623157E308', '999.1', '1.7976931348623157E308', '1.7976931348623157E308', '1.7976931348623157E308', '1.7976931348623157E308', '0', '', '', '', '0', '1', '0', '0', '0']
Traceback (most recent call last):
File "/home/ii/miniconda3/envs/teton_tech/lib/python3.7/site-packages/ib_insync/decoder.py", line 189, in interpret
handler(fields)
File "/home/ii/miniconda3/envs/teton_tech/lib/python3.7/site-packages/ib_insync/decoder.py", line 1016, in openOrder
self.parse(o)
File "/home/ii/miniconda3/envs/teton_tech/lib/python3.7/site-packages/ib_insync/decoder.py", line 201, in parse
setattr(obj, field.name, int(v) if v else field.default)
ValueError: invalid literal for int() with base 10: '0.67'

Most likely it has to do with discretionaryAmt field expecting ints instead of floats. Orders get sent correctly, so this seems to be openOrders() issue.

erdewit added a commit that referenced this issue Apr 13, 2020
@erdewit
Copy link
Owner

erdewit commented Apr 13, 2020

Indeed, discretionaryAmt should be float and this has been fixed in the repo. Thank you for reporting this issue.

@erdewit erdewit closed this as completed Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants