nautechsystems / nautilus_trader

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

Incorrect import for OrderBookImbalance example strategy #1651

Closed lufengkuang closed 1 month ago

lufengkuang commented 1 month ago

Bug Report

one of the examples doesn't work examples/live/binance/binance_futures_testnet_orderbook_imbalance.py

Expected Behavior

Add here...

Actual Behavior

the error message reads as follow:

Traceback (most recent call last): File "F:\quant\ntrader\test.py", line 103, in strategy = OrderBookImbalance(config=strat_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\office.conda\envs\ntrader\Lib\site-packages\nautilus_trader\examples\strategies\orderbook_imbalance_rust.py", line 116, in init self.book = nautilus_pyo3.OrderBook(self.book_type, pyo3_instrument_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument 'book_type': 'BookType' object cannot be converted to 'BookType'

Steps to Reproduce the Problem

  1. pip install -U nautilus_trader
  2. fill in my own testnet api key and secret in binance_futures_testnet_orderbook_imbalance.py
  3. run the py file

Specifications

cjdsellers commented 1 month ago

Hi @lufengkuang

Thanks for the report on this.

I've now fixed the import on develop branch.