Closed SeverinJB closed 2 years ago
Hi @SeverinJB
You're quite right, the Actor
was lacking a dedicated handler for instrument lists.
I've now added a request_instruments
method to the Actor
which also takes a venue (in case the data client handles multiple venues).
Since it looks like you're writing your own adapter, I've also added these convenience methods:
def _handle_instrument_py(self, Instrument instrument, UUID4 correlation_id)
def _handle_instruments_py(self, Venue venue, list instruments, UUID4 correlation_id)
cpdef void _handle_instrument(self, Instrument instrument, UUID4 correlation_id) except *
cpdef void _handle_instruments(self, Venue venue, list instruments, UUID4 correlation_id) except *
I've also covered the new code paths with tests d6ddbedf1ebd64e53779a6985d9b3acadc4d027a.
Thanks for much for the detailed report, and please let me know if this works for you.
Hi @cjdsellers,
Thank you for looking into this so swiftly!
I checked out the develop branch, built it with poetry install --no-dev
and then used pip install -e .
to install it in a clean conda environment, but I am getting this error whenever I try running the program:
<frozen importlib._bootstrap>:241: RuntimeWarning: nautilus_trader.common.clock.LiveClock size changed, may indicate binary incompatibility. Expected 288 from C header, got 312 from PyObject
Traceback (most recent call last):
File "/*/GitHub/nautilus_trader/examples/live/alpaca_scalping_strategy.py", line 22, in <module>
from nautilus_trader.live.node import TradingNode
File "/*/GitHub/nautilus_trader/nautilus_trader/live/node.py", line 38, in <module>
from nautilus_trader.system.kernel import NautilusKernel
File "nautilus_trader/system/kernel.pyx", line 1, in init nautilus_trader.system.kernel
ValueError: nautilus_trader.execution.messages.SubmitOrder size changed, may indicate binary incompatibility. Expected 104 from C header, got 96 from PyObject
I am sorry, but I don't have much experience with Cython and Rust. It looks like there is a problem with the built binaries, but I am not sure what I am doing wrong and how to fix it.
Do you have a tip?
So it looks like you have an old extension module in play there, for a truly clean build I would recommend this, with the caveat that its going to take everything which isn't tracked by git:
make clean build
I see you must be on an older version of develop
which still has a kernel.pyx
.
I'd also recommend if you're working from source you stay on the head of develop
to pick up any bug fixes.
Hope that helps!
Thank you, @cjdsellers! This did the trick.
Bug Report
Hi everybody - It looks like there is an issue with the actor's handle_instrument_response function. Let me know if I should be missing something!
Expected Behavior
The handle_instrument_response function can handle a list as the data engine requires the instrument to be wrapped in a list.
Actual Behavior
TypeError when passing an instrument wrapped by a list. See the below:
However, equally, we are getting an error when the list does not wrap the instrument as the data engine expects a list:
Steps to Reproduce the Problem
Specifications
nautilus_trader
version: 1.155.0