GithubHelp home page GithubHelp logo

Comments (4)

benjaminsingleton avatar benjaminsingleton commented on June 3, 2024 1

I believe I've found the source of the issue. In a dummy strategy that I created, an OrderUpdated event caused the same error. I noticed that trigger_price=Price('0.000') seemed to be related to issue and generated the same Could not convert ... with type str: tried to convert to double error.

The issue is that the arrow schema defined for OrderUpdated has "trigger_price": pa.float64(), which is different from "price": pa.string(). So I changed the schema type for "trigger_price": pa.string() and I didn't have the issue any more.

https://github.com/nautechsystems/nautilus_trader/blob/master/nautilus_trader/serialization/arrow/schema.py#L346

It's also worth noting that trigger_price is defined as a string here: https://github.com/nautechsystems/nautilus_trader/blob/master/nautilus_trader/serialization/arrow/schema.py#L146

I'll submit a PR.

from nautilus_trader.

pcgm-team avatar pcgm-team commented on June 3, 2024

Thank you, look forward to this fix.

from nautilus_trader.

pcgm-team avatar pcgm-team commented on June 3, 2024

If it is helpful, the debug log is:

 2024-01-24T15:20:46.040018271Z [DEBUG] TESTER-001.InteractiveBrokersClient-001: Msg handled: function=nextValidId data={'order_id': 179}
 2024-01-24T15:20:46.068841087Z [DEBUG] TESTER-001.InteractiveBrokersClient-001: Msg buffer received: b'\x00\x00\x00+3\x00179\x00Submitted\x000\x00824\x000\x00193966283\x000\x000\x001\x00\x000\x00'
 2024-01-24T15:20:46.068867984Z [DEBUG] TESTER-001.InteractiveBrokersClient-001: Msg buffer received: b''
 2024-01-24T15:20:46.068953319Z [DEBUG] TESTER-001.InteractiveBrokersClient-001: Msg received: b'5\x00179\x0010098\x00BAC\x00STK\x00\x000\x00?\x00\x00SMART\x00USD\x00BAC\x00BAC\x00BUY\x00824\x00MKT\x000.0\x000.0\x00GTC\x00\x00DU1435157\x00\x000\x00O-20240124-1520-001-000-1:179\x001\x00193966283\x000\x000\x000\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\x00\x00-1\x000\x00\x00\x00\x00\x00\x002147483647\x000\x000\x000\x00\x003\x000\x000\x00\x000\x000\x00\x000\x00None\x00\x000\x00\x00\x00\x00?\x000\x000\x00\x000\x000\x00\x00\x00\x00\x00\x000\x000\x000\x002147483647\x002147483647\x00\x00\x000\x00\x00IB\x000\x000\x00\x000\x000\x00Submitted\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x00\x00\x00\x00\x00\x000\x000\x000\x00None\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x001.7976931348623157E308\x000\x00\x00\x00\x000\x001\x000\x000\x000\x00\x00\x000\x00\x00100\x000.02\x00\x00\x00'
2024-01-24T15:20:46.068972335Z [DEBUG] TESTER-001.InteractiveBrokersClient-001: Msg received fields: (b'5', b'179', b'10098', b'BAC', b'STK', b'', b'0', b'?', b'', b'SMART', b'USD', b'BAC', b'BAC', b'BUY', b'824', b'MKT', b'0.0', b'0.0', b'GTC', b'', b'DU1435157', b'', b'0', b'O-20240124-1520-001-000-1:179', b'1', b'193966283', b'0', b'0', b'0', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'0', b'', b'-1', b'0', b'', b'', b'', b'', b'', b'2147483647', b'0', b'0', b'0', b'', b'3', b'0', b'0', b'', b'0', b'0', b'', b'0', b'None', b'', b'0', b'', b'', b'', b'?', b'0', b'0', b'', b'0', b'0', b'', b'', b'', b'', b'', b'0', b'0', b'0', b'2147483647', b'2147483647', b'', b'', b'0', b'', b'IB', b'0', b'0', b'', b'0', b'0', b'Submitted', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'', b'', b'', b'', b'', b'0', b'0', b'0', b'None', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'1.7976931348623157E308', b'0', b'', b'', b'', b'0', b'1', b'0', b'0', b'0', b'', b'', b'0', b'', b'100', b'0.02', b'', b'')
2024-01-24T15:20:46.069240683Z [DEBUG] TESTER-001.InteractiveBrokersClient-001: Msg handled: function=openOrder data={'order_id': 179, 'contract': 139900004386320: 10098,BAC,STK,,0,?,,SMART,,USD,BAC,BAC,False,,,,combo:, 'order': 139900152942608: 179,1,193966283: MKT BUY 824@0 GTC, 'order_state': <ibapi.order_state.OrderState object at 0x7f3d0aeaeb10>}
2024-01-24T15:20:46.069387604Z [DEBUG] TESTER-001.InteractiveBrokersClient-001: Msg received: b'3\x00179\x00Submitted\x000\x00824\x000\x00193966283\x000\x000\x001\x00\x000\x00'
2024-01-24T15:20:46.069402229Z [DEBUG] TESTER-001.InteractiveBrokersClient-001: Msg received fields: (b'3', b'179', b'Submitted', b'0', b'824', b'0', b'193966283', b'0', b'0', b'1', b'', b'0')
2024-01-24T15:20:46.069422238Z [DEBUG] TESTER-001.InteractiveBrokersClient-001: Msg handled: function=orderStatus data={'order_id': 179, 'status': 'Submitted', 'filled': Decimal('0'), 'remaining': Decimal('824'), 'avg_fill_price': 0.0, 'perm_id': 193966283, 'parent_id': 0, 'last_fill_price': 0.0, 'client_id': 1, 'why_held': '', 'mkt_cap_price': 0.0}
 2024-01-24T15:20:46.069428170Z [DEBUG] TESTER-001.ExecClient-INTERACTIVE_BROKERS: Ignoring `_on_order_status` event for order_status='Submitted' is handled in `_on_open_order`
Could not convert '0.00' with type str: tried to convert to double

from nautilus_trader.

pcgm-team avatar pcgm-team commented on June 3, 2024

You can see that the 'mkt_cap_price': 0.0, 'last_fill_price': 0.0 and 'avg_fill_price': 0.0, which may have something to do with it.

Also when I specify in the MessageBus config to not serialize any of the data classes, OrderEvent types, etc. the bug still occurs; but goes away as soon as you turn streaming off.

from nautilus_trader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.