nautechsystems / nautilus_trader

A high-performance algorithmic trading platform and event-driven backtester
https://nautilustrader.io
GNU Lesser General Public License v3.0
2.04k stars 465 forks source link

Rust OrderBookImbalance example strategy doesn't work #1971

Closed StephenLee2016 closed 1 week ago

StephenLee2016 commented 1 week ago

Bug Report one of the examples doesn't work examples/live/binance/binance_spot_orderbook_imbalance_rust.py

Expected Behavior Add here...

Actual Behavior the error message reads as follow:

Traceback (most recent call last): File "/Users/nautilus_trader/examples/live/binance/binance_spot_orderbook_imbalance_rust.py", line 105, in strategy = OrderBookImbalance(config=strat_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/nautilus_trader/nautilus_trader/examples/strategies/orderbook_imbalance_rust.py", line 108, in init self.book = nautilus_pyo3.OrderBook(self.book_type, pyo3_instrument_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument 'instrument_id': 'BookType' object cannot be converted to 'InstrumentId'

Steps to Reproduce the Problem pip install -U nautilus_trader fill in my own api key and secret in binance_spot_orderbook_imbalance_rust.py run the py file Specifications OS platform: Mac 13.4 M2 Python version: 3.11 nautilus_trader version: 1.203.0

cjdsellers commented 1 week ago

Hi @StephenLee2016

Thanks for the report. This was caused by a param ordering change, now fixed on develop branch from commit aa12f5db01124e74612be439f1481d4e961e0bef.