Skip to content

Commit 8aae236

Browse files
authored
Release 1.186.0
See release notes.
2 parents 9d09e96 + 2f49dc3 commit 8aae236

File tree

129 files changed

+4960
-2199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+4960
-2199
lines changed

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ repos:
4545
hooks:
4646
- id: fmt
4747
name: cargo fmt
48-
description: Format files with cargo fmt (nightly toolchain).
48+
description: Format files with cargo fmt.
4949
entry: cargo fmt
5050
language: system
5151
types: [rust]
@@ -73,7 +73,7 @@ repos:
7373
types: [python]
7474

7575
- repo: https://github.com/psf/black
76-
rev: 23.12.1
76+
rev: 24.1.1
7777
hooks:
7878
- id: black
7979
types_or: [python, pyi]
@@ -82,7 +82,7 @@ repos:
8282
exclude: "docs/_pygments/monokai.py"
8383

8484
- repo: https://github.com/astral-sh/ruff-pre-commit
85-
rev: v0.1.14
85+
rev: v0.1.15
8686
hooks:
8787
- id: ruff
8888
args: ["--fix"]

Makefile

+13-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ install:
1010

1111
.PHONY: install-debug
1212
install-debug:
13-
BUILD_MODE=debug poetry install --with dev,test --all-extras
13+
BUILD_MODE=debug poetry install --with dev,test --all-extras --sync
1414

1515
.PHONY: install-just-deps
1616
install-just-deps:
@@ -82,7 +82,7 @@ cargo-build:
8282

8383
.PHONY: cargo-update
8484
cargo-update:
85-
(cd nautilus_core && cargo update && cargo install cargo-nextest)
85+
(cd nautilus_core && cargo update && cargo install cargo-nextest && cargo install cargo-llvm-cov)
8686

8787
.PHONY: cargo-test
8888
cargo-test:
@@ -92,9 +92,17 @@ cargo-test:
9292
fi
9393
RUST_BACKTRACE=1 && (cd nautilus_core && cargo nextest run --workspace --exclude tokio-tungstenite)
9494

95-
.PHONY: cargo-test-nightly
96-
cargo-test-nightly:
97-
RUST_BACKTRACE=1 && (cd nautilus_core && cargo +nightly test)
95+
.PHONY: cargo-test-coverage
96+
cargo-test-coverage:
97+
@if ! cargo nextest --version >/dev/null 2>&1; then \
98+
echo "cargo-nextest is not installed. You can install it using 'cargo install cargo-nextest'"; \
99+
exit 1; \
100+
fi
101+
@if ! cargo llvm-cov --version >/dev/null 2>&1; then \
102+
echo "cargo-llvm-cov is not installed. You can install it using 'cargo install cargo-llvm-cov'"; \
103+
exit 1; \
104+
fi
105+
RUST_BACKTRACE=1 && (cd nautilus_core && cargo llvm-cov nextest run --workspace --exclude tokio-tungstenite)
98106

99107
.PHONY: cargo-bench
100108
cargo-bench:

RELEASES.md

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# NautilusTrader 1.186.0 Beta
2+
3+
Released on 2nd February 2024 (UTC).
4+
5+
### Enhancements
6+
None
7+
8+
### Breaking Changes
9+
None
10+
11+
### Fixes
12+
- Fixed Interactive Brokers get account positions bug (#1475), thanks @benjaminsingleton
13+
- Fixed `TimeBarAggregator` handling of interval types on build
14+
- Fixed `BinanceSpotExecutionClient` non-existent method name, thanks @sunlei
15+
- Fixed unused `psutil` import, thanks @sunlei
16+
17+
---
18+
119
# NautilusTrader 1.185.0 Beta
220

321
Released on 26th January 2024 (UTC).

build.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env python3
22

3+
import datetime
34
import itertools
45
import os
56
import platform
67
import shutil
78
import subprocess
89
import sysconfig
9-
from datetime import datetime
1010
from pathlib import Path
1111

1212
import numpy as np
@@ -350,7 +350,7 @@ def build() -> None:
350350
print(f"PYO3_ONLY={PYO3_ONLY}\n")
351351

352352
print("Starting build...")
353-
ts_start = datetime.utcnow()
353+
ts_start = datetime.datetime.now(datetime.timezone.utc)
354354
build()
355-
print(f"Build time: {datetime.utcnow() - ts_start}")
355+
print(f"Build time: {datetime.datetime.now(datetime.timezone.utc) - ts_start}")
356356
print("\033[32m" + "Build completed" + "\033[0m")

docs/getting_started/installation.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ To install the latest binary wheel (or sdist package) from PyPI using Pythons _p
2222
Install optional dependencies as 'extras' for specific integrations:
2323

2424
- `betfair`: Betfair adapter (integration)
25-
- `databento`: Databento adapter (integration)
26-
- `docker`: Needed for Docker when using the IB gateway
25+
- `docker`: Needed for Docker when using the IB gateway (with the Interactive Brokers adapter)
2726
- `ib`: Interactive Brokers adapter
2827

2928
To install with specific extras using _pip_:

examples/live/databento/databento_subscriber.py

+15-13
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
from nautilus_trader.config.common import StrategyConfig
2727
from nautilus_trader.live.node import TradingNode
2828
from nautilus_trader.model.book import OrderBook
29+
30+
# from nautilus_trader.model.data import BarType
2931
from nautilus_trader.model.data import OrderBookDeltas
3032
from nautilus_trader.model.data import QuoteTick
3133
from nautilus_trader.model.data import TradeTick
32-
from nautilus_trader.model.enums import BookType
3334
from nautilus_trader.model.identifiers import InstrumentId
3435
from nautilus_trader.model.identifiers import TraderId
3536
from nautilus_trader.trading.strategy import Strategy
@@ -41,8 +42,8 @@
4142
# For correct subscription operation, you must specify all instruments to be immediately
4243
# subscribed for as part of the data client configuration
4344
instrument_ids = [
44-
# InstrumentId.from_str("AAPL.XCHI"),
45-
# InstrumentId.from_str("ESH4.GLBX"),
45+
InstrumentId.from_str("AAPL.XCHI"),
46+
InstrumentId.from_str("ESH4.GLBX"),
4647
InstrumentId.from_str("ESM4.GLBX"),
4748
]
4849

@@ -80,6 +81,7 @@
8081
http_gateway=None,
8182
instrument_provider=InstrumentProviderConfig(load_all=True),
8283
instrument_ids=instrument_ids,
84+
parent_symbols={"GLBX.MDP3": {"ES.FUT", "ES.OPT"}},
8385
),
8486
},
8587
timeout_connection=10.0,
@@ -128,7 +130,7 @@ def on_start(self) -> None:
128130
"""
129131
Actions to be performed when the strategy is started.
130132
131-
Here we specify the 'DATABENTO' client for subscriptions.
133+
Here we specify the 'DATABENTO' client_id for subscriptions.
132134
133135
"""
134136
for instrument_id in self.instrument_ids:
@@ -137,15 +139,15 @@ def on_start(self) -> None:
137139
# book_type=BookType.L3_MBO,
138140
# client_id=DATABENTO_CLIENT_ID,
139141
# )
140-
self.subscribe_order_book_snapshots(
141-
instrument_id=instrument_id,
142-
book_type=BookType.L2_MBP,
143-
depth=10,
144-
client_id=DATABENTO_CLIENT_ID,
145-
interval_ms=100,
146-
)
147-
# self.subscribe_quote_ticks(instrument_id, client_id=DATABENTO_CLIENT_ID)
148-
# self.subscribe_trade_ticks(instrument_id, client_id=DATABENTO_CLIENT_ID)
142+
# self.subscribe_order_book_snapshots(
143+
# instrument_id=instrument_id,
144+
# book_type=BookType.L2_MBP,
145+
# depth=10,
146+
# client_id=DATABENTO_CLIENT_ID,
147+
# interval_ms=100,
148+
# )
149+
self.subscribe_quote_ticks(instrument_id, client_id=DATABENTO_CLIENT_ID)
150+
self.subscribe_trade_ticks(instrument_id, client_id=DATABENTO_CLIENT_ID)
149151
# self.request_quote_ticks(instrument_id)
150152
# self.request_trade_ticks(instrument_id)
151153
# self.request_bars(BarType.from_str(f"{instrument_id}-1-MINUTE-LAST-EXTERNAL"))

0 commit comments

Comments
 (0)