Skip to content

Commit 63c191b

Browse files
authored
Release 1.181.0
See release notes.
2 parents 622014e + cdcf2fd commit 63c191b

File tree

630 files changed

+23958
-14379
lines changed

Some content is hidden

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

630 files changed

+23958
-14379
lines changed

.docker/nautilus_trader.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ENV PYTHONUNBUFFERED=1 \
44
PIP_NO_CACHE_DIR=off \
55
PIP_DISABLE_PIP_VERSION_CHECK=on \
66
PIP_DEFAULT_TIMEOUT=100 \
7-
POETRY_VERSION=1.6.1 \
7+
POETRY_VERSION=1.7.1 \
88
POETRY_HOME="/opt/poetry" \
99
POETRY_VIRTUALENVS_CREATE=false \
1010
POETRY_NO_INTERACTION=1 \

.github/workflows/build-wheels.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: build-wheels
22

3-
# Build Linux wheels on successful completion of the `coverage` workflow on the `develop` branch
4-
# Temporarily build wheels on every push to `develop` branch
3+
# Build wheels on every push to `develop` branch
54

65
on:
76
push:
@@ -15,7 +14,7 @@ jobs:
1514
matrix:
1615
arch: [x64]
1716
os: [ubuntu-latest]
18-
python-version: ["3.11"]
17+
python-version: ["3.11", "3.12"]
1918
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
2019
runs-on: ${{ matrix.os }}
2120

@@ -31,12 +30,22 @@ jobs:
3130
echo "RUST_VERSION=$version" >> $GITHUB_ENV
3231
working-directory: ${{ github.workspace }}
3332

34-
- name: Set up Rust tool-chain (stable)
33+
- name: Set up Rust tool-chain (Linux, Windows) stable
34+
if: (runner.os == 'Linux') || (runner.os == 'Windows')
3535
uses: actions-rust-lang/[email protected]
3636
with:
3737
toolchain: ${{ env.RUST_VERSION }}
3838
components: rustfmt, clippy
3939

40+
# Work around as actions-rust-lang does not seem to work on macOS yet
41+
- name: Set up Rust tool-chain (macOS) stable
42+
if: runner.os == 'macOS'
43+
uses: actions-rs/toolchain@v1
44+
with:
45+
toolchain: ${{ env.RUST_VERSION }}
46+
override: true
47+
components: rustfmt, clippy
48+
4049
- name: Set up Python environment
4150
uses: actions/setup-python@v4
4251
with:

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
arch: [x64]
1717
os: [ubuntu-latest, macos-latest, windows-latest]
18-
python-version: ["3.10", "3.11"]
18+
python-version: ["3.10", "3.11", "3.12"]
1919
defaults:
2020
run:
2121
shell: bash

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
matrix:
1919
arch: [x64]
2020
os: [ubuntu-latest, macos-latest, windows-latest]
21-
python-version: ["3.10", "3.11"]
21+
python-version: ["3.10", "3.11", "3.12"]
2222
defaults:
2323
run:
2424
shell: bash
@@ -244,8 +244,8 @@ jobs:
244244
fail-fast: false
245245
matrix:
246246
arch: [x64]
247-
os: [ubuntu-20.04, ubuntu-latest, windows-latest]
248-
python-version: ["3.10", "3.11"]
247+
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
248+
python-version: ["3.10", "3.11", "3.12"]
249249
defaults:
250250
run:
251251
shell: bash

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
*.xml
1414
*.key
1515
*.key_secret
16+
*.sqlite
17+
*.env
1618

1719
.benchmarks*
1820
.coverage*
@@ -57,3 +59,4 @@ tests/test_data/catalog/
5759
bench_data/
5860

5961
!tests/integration_tests/adapters/betfair/responses/*.log
62+
**/test_db.sqlite

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ repos:
7373
types: [python]
7474

7575
- repo: https://github.com/psf/black
76-
rev: 23.10.1
76+
rev: 23.11.0
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.3
85+
rev: v0.1.6
8686
hooks:
8787
- id: ruff
8888
args: ["--fix"]
@@ -111,7 +111,7 @@ repos:
111111
]
112112

113113
- repo: https://github.com/pre-commit/mirrors-mypy
114-
rev: v1.6.1
114+
rev: v1.7.1
115115
hooks:
116116
- id: mypy
117117
args: [

Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ format:
4848
pre-commit:
4949
pre-commit run --all-files
5050

51-
.PHONY: pre-flight
52-
pre-flight: format pre-commit cargo-test build-debug pytest
53-
5451
.PHONY: ruff
5552
ruff:
5653
ruff check . --fix
@@ -132,3 +129,12 @@ pytest-coverage:
132129
.PHONY: test-examples
133130
test-examples:
134131
bash scripts/test-examples.sh
132+
133+
.PHONY: init-db
134+
init-db:
135+
(cd nautilus_core && cargo run --bin init-db)
136+
137+
.PHONY: drop-db
138+
drop-db:
139+
(cd nautilus_core && cargo run --bin drop-db)
140+

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
| Platform | Rust | Python |
1616
| :----------------- | :------ | :----- |
17-
| `Linux (x86_64)` | 1.73.0+ | 3.10+ |
18-
| `macOS (x86_64)` | 1.73.0+ | 3.10+ |
19-
| `macOS (arm64)` | 1.73.0+ | 3.10+ |
20-
| `Windows (x86_64)` | 1.73.0+ | 3.10+ |
17+
| `Linux (x86_64)` | 1.74.0+ | 3.10+ |
18+
| `macOS (x86_64)` | 1.74.0+ | 3.10+ |
19+
| `macOS (arm64)` | 1.74.0+ | 3.10+ |
20+
| `Windows (x86_64)` | 1.74.0+ | 3.10+ |
2121

2222
- **Website:** https://nautilustrader.io
2323
- **Docs:** https://docs.nautilustrader.io
@@ -136,7 +136,7 @@ This project makes the [Soundness Pledge](https://raphlinus.github.io/rust/2020/
136136
## Integrations
137137

138138
NautilusTrader is designed in a modular way to work with 'adapters' which provide
139-
connectivity to data publishers and/or trading venues - converting their raw API
139+
connectivity to data providers and/or trading venues - converting their raw API
140140
into a unified interface. The following integrations are currently supported:
141141

142142
| Name | ID | Type | Status | Docs |

RELEASES.md

+43-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
# NautilusTrader 1.181.0 Beta
2+
3+
Released on 2nd December (UTC).
4+
5+
This release adds support for Python 3.12.
6+
7+
### Enhancements
8+
- Rewrote Interactive Brokers integration documentation, many thanks @benjaminsingleton
9+
- Added Interactive Brokers adapter support for crypto instruments with cash quantity, thanks @benjaminsingleton
10+
- Added `HistoricInteractiveBrokerClient`, thanks @benjaminsingleton and @limx0
11+
- Added `DataEngineConfig.time_bars_interval_type` (determines the type of interval used for time aggregation `left-open` or `right-open`)
12+
- Added `LoggingConfig.log_colors` to optionally use ANSI codes to produce colored logs (default true to retain current behavior)
13+
- Added `QuoteTickDataWrangler.process_bar_data` options for `offset_interval_ms` and `timestamp_is_close`
14+
- Added identifier generators in Rust, thanks @filipmacek
15+
- Added `OrderFactory` in Rust, thanks @filipmacek
16+
- Added `WilderMovingAverage` in Rust, thanks @ayush-sb
17+
- Added `HullMovingAverage` in Rust, thanks @ayush-sb
18+
- Added all common identifier generators in Rust, thanks @filipmacek
19+
- Added generic SQL database support with `sqlx` in Rust, thanks @filipmacek
20+
21+
### Breaking Changes
22+
- Consolidated all `data` submodules into one `data` module (reduce binary wheel size)
23+
- Moved `OrderBook` from `model.orderbook.book` to `model.book` (subpackage only had this single module)
24+
- Moved `Currency` from `model.currency` to `model.objects` (consolidating modules to reduce binary wheel size)
25+
- Moved `MessageBus` from `common.msgbus` to `common.component` (consolidating modules to reduce binary wheel size)
26+
- Moved `MsgSpecSerializer` from `serialization.msgpack.serializer` to `serialization.serializer`
27+
- Moved `CacheConfig` `snapshot_orders`, `snapshot_positions`, `snapshot_positions_interval` to `NautilusKernelConfig` (logical applicability)
28+
- Renamed `MsgPackSerializer` to `MsgSpecSeralizer` (now handles both JSON and MsgPack formats)
29+
30+
### Fixes
31+
- Fixed missing `trader_id` in `Position` dictionary representation, thanks @filipmacek
32+
- Fixed conversion of fixed precision integers to floats (should be dividing to avoid rounding errors), thanks for reporting @filipmacek
33+
- Fixed daily timestamp parsing for Interactive Brokers, thanks @benjaminsingleton
34+
- Fixed live reconciliation trade processing for partially filled then canceled orders
35+
- Fixed `RiskEngine` cumulative notional risk check for `CurrencyPair` SELL orders on multi-currency cash accounts
36+
37+
---
38+
139
# NautilusTrader 1.180.0 Beta
240

341
Released on 3rd November 2023 (UTC).
@@ -7,7 +45,7 @@ Released on 3rd November 2023 (UTC).
745
- Improved `RedisCacheDatabase` client connection error handling with retries
846
- Added `WebSocketClient` connection headers, thanks @ruthvik125 and @twitu
947
- Added `support_contingent_orders` option for venues (to simulate venues which do not support contingent orders)
10-
- Added `StrategyConfig.manage_contingent_orders` option (to automatically manage **open** contingenct orders)
48+
- Added `StrategyConfig.manage_contingent_orders` option (to automatically manage **open** contingent orders)
1149
- Added `FuturesContract.activation_utc` property which returns a `pd.Timestamp` tz-aware (UTC)
1250
- Added `OptionsContract.activation_utc` property which returns a `pd.Timestamp` tz-aware (UTC)
1351
- Added `CryptoFuture.activation_utc` property which returns a `pd.Timestamp` tz-aware (UTC)
@@ -19,9 +57,9 @@ Released on 3rd November 2023 (UTC).
1957
- Renamed `FuturesContract.expiry_date` to `expiration_ns` (and associated params) as `uint64_t` UNIX nanoseconds
2058
- Renamed `OptionsContract.expiry_date` to `expiration_ns` (and associated params) as `uint64_t` UNIX nanoseconds
2159
- Renamed `CryptoFuture.expiry_date` to `expiration_ns` (and associated params) as `uint64_t` UNIX nanoseconds
22-
- Changed `FuturesContract` arrow schema
23-
- Changed `OptionsContract` arrow schema
24-
- Changed `CryptoFuture` arrow schema
60+
- Changed `FuturesContract` Arrow schema
61+
- Changed `OptionsContract` Arrow schema
62+
- Changed `CryptoFuture` Arrow schema
2563
- Transformed orders will now retain the original `ts_init` timestamp
2664
- Removed unimplemented `batch_more` option for `Strategy.modify_order`
2765
- Removed `InstrumentProvider.venue` property (redundant as a provider may have many venues)
@@ -275,7 +313,7 @@ Released on 19th May 2023 (UTC).
275313
- Fixed `MatchingEngine` processing of reduce only for child contingent orders
276314
- Fixed `MatchingEngine` position ID assignment for child contingent orders
277315
- Fixed `Actor` handling of historical data from requests (will now call `on_historical_data` regardless of state), thanks for reporting @miller-moore
278-
- Fixed pyarrow schema dictionary index keys being too narrow (int8 -> int16), thanks for reporting @rterbush
316+
- Fixed `pyarrow` schema dictionary index keys being too narrow (int8 -> int16), thanks for reporting @rterbush
279317

280318
---
281319

build.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ def _build_extensions() -> list[Extension]:
159159
"User32.Lib",
160160
"UserEnv.Lib",
161161
"WS2_32.Lib",
162+
"Crypt32.lib",
163+
"secur32.lib",
164+
"schannel.lib",
165+
"ncrypt.lib",
162166
]
163167

164168
print("Creating C extension modules...")
@@ -312,7 +316,8 @@ def build() -> None:
312316
# Copy the build back into the source tree for development and wheel packaging
313317
_copy_build_dir_to_project(cmd)
314318

315-
if platform.system() in ("Linux", "Darwin"):
319+
if BUILD_MODE == "release" and platform.system() in ("Linux", "Darwin"):
320+
# Only strip symbols for release builds
316321
_strip_unneeded_symbols()
317322

318323

docs/api_reference/common.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,9 @@
8686
:member-order: bysource
8787
```
8888

89-
## Timer
90-
89+
## Message Bus
9190
```{eval-rst}
92-
.. automodule:: nautilus_trader.common.timer
91+
.. automodule:: nautilus_trader.common.msgbus
9392
:show-inheritance:
9493
:inherited-members:
9594
:members:

docs/api_reference/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
infrastructure.md
2020
live.md
2121
model/index.md
22-
msgbus.md
2322
persistence.md
2423
portfolio.md
2524
risk.md

docs/api_reference/model/book.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Order Book
2+
3+
```{eval-rst}
4+
.. automodule:: nautilus_trader.model.book
5+
```

docs/api_reference/model/currency.md

-9
This file was deleted.

docs/api_reference/model/data.md

-48
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,3 @@
33
```{eval-rst}
44
.. automodule:: nautilus_trader.model.data
55
```
6-
7-
```{eval-rst}
8-
.. automodule:: nautilus_trader.model.data.bar
9-
:show-inheritance:
10-
:inherited-members:
11-
:members:
12-
:member-order: bysource
13-
```
14-
15-
```{eval-rst}
16-
.. automodule:: nautilus_trader.model.data.book
17-
:show-inheritance:
18-
:inherited-members:
19-
:members:
20-
:member-order: bysource
21-
```
22-
23-
```{eval-rst}
24-
.. automodule:: nautilus_trader.model.data.status
25-
:show-inheritance:
26-
:inherited-members:
27-
:members:
28-
:member-order: bysource
29-
```
30-
31-
```{eval-rst}
32-
.. automodule:: nautilus_trader.model.data.tick
33-
:show-inheritance:
34-
:inherited-members:
35-
:members:
36-
:member-order: bysource
37-
```
38-
39-
```{eval-rst}
40-
.. automodule:: nautilus_trader.model.data.ticker
41-
:show-inheritance:
42-
:inherited-members:
43-
:members:
44-
:member-order: bysource
45-
```
46-
47-
```{eval-rst}
48-
.. automodule:: nautilus_trader.model.data.base
49-
:show-inheritance:
50-
:inherited-members:
51-
:members:
52-
:member-order: bysource
53-
```

docs/api_reference/model/index.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
:titlesonly:
1212
:hidden:
1313
14-
currency.md
14+
book.md
1515
data.md
1616
events.md
1717
identifiers.md
1818
instruments.md
1919
objects.md
20-
orderbook.md
2120
orders.md
2221
position.md
2322
tick_scheme.md

docs/api_reference/model/orderbook.md

-13
This file was deleted.

0 commit comments

Comments
 (0)