nautechsystems / nautilus_trader

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

Low level backtest in documentation needs some adjustments so it works straight away #1655

Closed faysou closed 4 months ago

faysou commented 4 months ago

Bug Report

Expected Behavior

backtest_low_level should work straight away by copying and pasting from the documentation. Also it would be nice if it was as a notebook format as well in the examples folder when cloning the nautilus_trader repo.

Actual Behavior

I needed the following adjustments to make the tutorial work:

The venue needs to be defined before adding instruments (move the corresponding instructions up).

The BarType class needs to be imported.
from nautilus_trader.model.data import BarType

cjdsellers commented 4 months ago

Thanks @faysou

I've addressed the issues you've mentioned. I agree that a notebook format would be nice, these examples could be improved a lot but the ones we have should at least work straight away as you say.

Now fixed on develop branch and will be reflected in nightly docs once merged.

faysou commented 4 months ago

Thank you @cjdsellers, and thank you for your work on probably the best open source backtester available.

(The integration with databento is useful for me, they will soon release best bid offer data sampled on a fixed interval like 1 minute, which will make backtesting option strategies very cost effective (https://roadmap.databento.com/roadmap/fixed-interval-mbp-1-summaries-eg-1-minute-bbo-or-subsampled-bbo), currently best bid offer is only available at a higher granularity everytime it changes, which is much bigger in size)