Comments (4)
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.
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.
Thank you, look forward to this fix.
from nautilus_trader.
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.
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)
- No account registered error for IBKR HOT 8
- Delays for live trading HOT 3
- Sell order denied due to CUM_NOTIONAL_EXCEEDS_FREE_BALANCE when there is enough balance HOT 4
- Addition of Sequence Number in QuoteTick HOT 2
- Polygon.io integration HOT 1
- Sandbox: Error on applying OrderFilled due to incorrect venu_order_id HOT 5
- Sandbox: fills are applied multiple times to the same limit order HOT 10
- Timer is panicking when calling `set_time_alert_ns` HOT 9
- Sandbox: fills are generated by internally aggregated bars instead of quote/ticks HOT 4
- Get radis error in trimming stream HOT 8
- Incorrect import for OrderBookImbalance example strategy HOT 1
- Low level backtest in documentation needs some adjustments so it works straight away HOT 2
- Cannot pull out account information in SANDBOX mode HOT 4
- Improve error message when no tick scheme for instrument HOT 3
- Multi-currency support for SANDBOX mode HOT 1
- Orders accepted and not filled in SANDBOX HOT 9
- Latency modeling for sandbox/real-time
- Highlevel api tutorial document bugs HOT 1
- Invalid size precision for fill 5 when instrument size precision is 6, on 1.194.0 HOT 4
- Documentation - clang is a "From Source" installation dependency HOT 1
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 nautilus_trader.