Skip to content

Commit 313d769

Browse files
authored
Release 1.144.0
See release notes.
2 parents 1540a76 + 949f81c commit 313d769

File tree

290 files changed

+12287
-3140
lines changed

Some content is hidden

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

290 files changed

+12287
-3140
lines changed

.docker/nautilus_trader.dockerfile

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ ENV PYTHONUNBUFFERED=1 \
99
POETRY_VIRTUALENVS_CREATE=false \
1010
POETRY_NO_INTERACTION=1 \
1111
PYSETUP_PATH="/opt/pysetup"
12-
ENV PATH="$POETRY_HOME/bin:$PATH"
12+
ENV PATH="/root/.cargo/bin:$POETRY_HOME/bin:$PATH"
1313
WORKDIR $PYSETUP_PATH
1414

1515
FROM base as builder
1616

1717
# Install build deps
1818
RUN apt-get update && apt-get install -y gcc curl
1919

20+
# Install Rust stable
21+
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
22+
2023
# Install poetry
2124
RUN curl -sSL https://install.python-poetry.org | python3 -
2225

@@ -25,6 +28,7 @@ COPY poetry.lock pyproject.toml build.py ./
2528
RUN poetry install --no-root --no-dev
2629

2730
# Build nautilus_trader
31+
COPY nautilus_core ./nautilus_core
2832
COPY nautilus_trader ./nautilus_trader
2933
COPY README.md ./
3034
RUN poetry install --no-dev

.github/workflows/build.yml

+12
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
- name: Checkout repository
2323
uses: actions/checkout@v2
2424

25+
# Rust setup
26+
- name: Set up Rust environment
27+
uses: hecrj/setup-rust-action@v1
28+
with:
29+
rust-version: stable
30+
components: clippy
31+
2532
# Python setup
2633
- name: Set up Python environment
2734
uses: actions/setup-python@v2
@@ -73,6 +80,11 @@ jobs:
7380
sudo apt-get install redis-server
7481
redis-server --daemonize yes
7582
83+
- name: Install Memurai (Windows)
84+
if: runner.os == 'Windows'
85+
run: |
86+
choco install memurai-developer.install
87+
7688
# Run tests (Linux)
7789
- name: Run tests (Linux)
7890
if: runner.os == 'Linux'

.github/workflows/docker.yml

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ jobs:
1515
- name: Checkout repository
1616
uses: actions/checkout@v2
1717

18+
# Rust setup
19+
- name: Set up Rust environment
20+
uses: hecrj/setup-rust-action@v1
21+
with:
22+
rust-version: stable
23+
components: clippy
24+
1825
# Python setup
1926
- name: Set up Python environment
2027
uses: actions/setup-python@v2

.github/workflows/docs.yml

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ jobs:
1313
- name: Checkout repository
1414
uses: actions/checkout@v2
1515

16+
# Rust setup
17+
- name: Set up Rust environment
18+
uses: hecrj/setup-rust-action@v1
19+
with:
20+
rust-version: stable
21+
components: clippy
22+
1623
# Python setup
1724
- name: Set up Python environment
1825
uses: actions/setup-python@v2

.github/workflows/release.yml

+31-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ jobs:
2525
- name: Checkout repository
2626
uses: actions/checkout@v2
2727

28+
# Rust setup
29+
- name: Set up Rust environment
30+
uses: hecrj/setup-rust-action@v1
31+
with:
32+
rust-version: stable
33+
components: clippy
34+
2835
# Python setup
2936
- name: Set up Python environment
3037
uses: actions/setup-python@v2
@@ -38,7 +45,7 @@ jobs:
3845
3946
# Test pip installation
4047
- name: Test pip installation
41-
run: pip install .[distributed,docs]
48+
run: pip install .
4249

4350
tag-release:
4451
needs: [ test-pip-install ]
@@ -53,6 +60,13 @@ jobs:
5360
with:
5461
fetch-depth: 2
5562

63+
# Rust setup
64+
- name: Set up Rust environment
65+
uses: hecrj/setup-rust-action@v1
66+
with:
67+
rust-version: stable
68+
components: clippy
69+
5670
# Python setup
5771
- name: Set up Python environment
5872
uses: actions/setup-python@v2
@@ -116,13 +130,19 @@ jobs:
116130
name: publish-sdist - Python 3.10 (ubuntu-latest)
117131
runs-on: ubuntu-latest
118132
env:
119-
# Skip build copy to avoid *.so files being copied into the source
120133
SKIP_BUILD_COPY: true
121134

122135
steps:
123136
- name: Checkout repository
124137
uses: actions/checkout@v2
125138

139+
# Rust setup
140+
- name: Set up Rust environment
141+
uses: hecrj/setup-rust-action@v1
142+
with:
143+
rust-version: stable
144+
components: clippy
145+
126146
# Python setup
127147
- name: Set up Python environment
128148
uses: actions/setup-python@v2
@@ -192,11 +212,20 @@ jobs:
192212
python-version: [ "3.8", "3.9", "3.10" ]
193213
name: publish-wheels - Python ${{ matrix.python-version }} (${{ matrix.os }})
194214
runs-on: ${{ matrix.os }}
215+
env:
216+
CARGO_MODE: release
195217

196218
steps:
197219
- name: Checkout repository
198220
uses: actions/checkout@v2
199221

222+
# Rust setup
223+
- name: Set up Rust environment
224+
uses: hecrj/setup-rust-action@v1
225+
with:
226+
rust-version: stable
227+
components: clippy
228+
200229
# Python setup
201230
- name: Set up Python environment
202231
uses: actions/setup-python@v2

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ examples/backtest/notebooks/catalog
4747
nautilus_trader/**/.gitignore
4848
docs/**/*.ipynb
4949
!nautilus_trader/core/pytime.h
50+
!nautilus_core/lib/**/*

.pre-commit-config.yaml

+22-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
repos:
2-
2+
##############################################################################
3+
# General checks
4+
##############################################################################
35
- repo: https://github.com/pre-commit/pre-commit-hooks
46
rev: v4.2.0
57
hooks:
68
- id: forbid-new-submodules
79
- id: fix-encoding-pragma
810
args: [--remove]
911
- id: end-of-file-fixer
10-
types_or: [python, cython]
12+
types_or: [python, cython, rust]
1113
- id: trailing-whitespace
1214
types_or: [python, cython]
1315
- id: debug-statements
@@ -30,8 +32,22 @@ repos:
3032
types_or: [python, cython, rst, markdown]
3133
exclude: "nautilus_trader/adapters/betfair/parsing.py|nautilus_trader/adapters/betfair/execution.py|tests/integration_tests/adapters/betfair/test_kit.py|nautilus_trader/adapters/binance/futures/schemas/user.py"
3234

35+
##############################################################################
36+
# Rust checks
37+
##############################################################################
38+
- repo: https://github.com/doublify/pre-commit-rust
39+
rev: v1.0
40+
hooks:
41+
- id: cargo-check
42+
args: ["--manifest-path", "nautilus_core/Cargo.toml"]
43+
- id: clippy
44+
args: ["--manifest-path", "nautilus_core/Cargo.toml"]
45+
46+
##############################################################################
47+
# Python/Cython checks
48+
##############################################################################
3349
- repo: https://github.com/hadialqattan/pycln
34-
rev: v1.3.1
50+
rev: v1.3.2
3551
hooks:
3652
- id: pycln
3753
name: pycln (Python unused imports)
@@ -61,9 +77,10 @@ repos:
6177
--lines-after-imports=2,
6278
--use-parentheses,
6379
]
80+
exclude: "nautilus_trader/core/rust"
6481

6582
- repo: https://github.com/pre-commit/mirrors-mypy
66-
rev: v0.942
83+
rev: v0.950
6784
hooks:
6885
- id: mypy
6986
args: [
@@ -105,7 +122,7 @@ repos:
105122
--max-complexity=10,
106123
--max-line-length=150,
107124
--statistics,
108-
--ignore=C101 E203 E252 E402 D100 D101 D102 S101 S403 W503,
125+
--ignore=C101 E203 E252 E402 D100 D101 D102 S101 S403 S404 W503,
109126
--min-python-version=3.8.0
110127
]
111128
- id: flake8

Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ clean:
2020
rm -rf cython_debug
2121
rm -rf dist
2222
rm -rf docs/build
23+
find . -name target -type d -exec rm -rf {} +
2324
find . -name .benchmarks -type d -exec rm -rf {} +
2425
find . -name '*.dll' -exec rm {} +
2526
find . -name '*.prof' -exec rm {} +
@@ -34,9 +35,16 @@ clean:
3435
docs:
3536
poetry run sphinx-build docs docs/build/html -b html
3637

37-
pre-commit:
38+
format:
39+
(cd nautilus_core && cargo fmt)
40+
41+
pre-commit: format
3842
pre-commit run --all-files
3943

44+
update:
45+
(cd nautilus_core && cargo update)
46+
poetry update
47+
4048
docker-build: clean
4149
docker pull ${IMAGE_FULL} || docker pull ${IMAGE}:develop || true
4250
docker build -f .docker/nautilus_trader.dockerfile --platform linux/x86_64 -t ${IMAGE_FULL} .

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ including FX, Equities, Futures, Options, CFDs, Crypto and Betting - across mult
4848

4949
## Features
5050

51-
- **Fast:** C-level speed through Cython. Asynchronous networking with [uvloop](https://github.com/MagicStack/uvloop)
52-
- **Reliable:** Type safety through Cython. Redis backed performant state persistence
51+
- **Fast:** C-level speed through Rust and Cython. Asynchronous networking with [uvloop](https://github.com/MagicStack/uvloop)
52+
- **Reliable:** Type safety through Rust and Cython. Redis backed performant state persistence
5353
- **Flexible:** OS independent, runs on Linux, macOS, Windows. Deploy using Docker
5454
- **Integrated:** Modular adapters mean any REST, WebSocket, or FIX API can be integrated
5555
- **Advanced:** Time in force `IOC`, `FOK`, `GTD`, `AT_THE_OPEN`, `AT_THE_CLOSE`, advanced order types and conditional triggers. Execution instructions `post-only`, `reduce-only`, and icebergs. Contingency order lists including `OCO`, `OTO`
@@ -167,7 +167,7 @@ as specified in the `pyproject.toml`. However, we highly recommend installing us
167167
1. Install [rustup](https://rustup.rs/) (the Rust toolchain installer):
168168
- Linux and macOS:
169169
```
170-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
170+
curl https://sh.rustup.rs -sSf | sh
171171
```
172172
- Windows:
173173
- Download and install [`rustup-init.exe`](https://win.rustup.rs/x86_64)
@@ -373,7 +373,7 @@ Contributors are also required to sign a standard Contributor License Agreement
373373
---
374374

375375
Copyright (C) 2015-2022 Nautech Systems Pty Ltd. All rights reserved.
376-
https://nautechsystems.io
376+
https://nautilustrader.io
377377

378378
![nautechsystems](https://github.com/nautechsystems/nautilus_trader/blob/develop/docs/_images/ns-logo.png?raw=true "nautechsystems")
379379
<img src="https://github.com/nautechsystems/nautilus_trader/blob/develop/docs/_images/ferris.png" width="128">

RELEASES.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
# NautilusTrader 1.144.0 Beta
2+
3+
Released on 10th May 2022 (UTC).
4+
5+
### Breaking Changes
6+
- Removed `BacktestEngine.add_ticks()` as redundant with `.add_data()`
7+
- Removed `BacktestEngine.add_bars()` as redundant with `.add_data()`
8+
- Removed `BacktestEngine.add_generic_data()` as redundant with `.add_data()`
9+
- Removed `BacktestEngine.add_order_book_data()` as redundant with `.add_data()`
10+
- Renamed `Position.from_order` to `Position.opening_order_id`
11+
- Renamed `StreamingPersistence` to `StreamingFeatherWriter`
12+
- Renamed `PersistenceConfig` to `StreamingConfig`
13+
- Renamed `PersistenceConfig.flush_interval` to `flush_interval_ms`
14+
15+
### Enhancements
16+
- Added `Actor.publish_signal` for generic dynamic signal data
17+
- Added `WEEK` and `MONTH` bar aggregation options
18+
- Added `Position.closing_order_id` property
19+
- Added `tags` param to `Strategy.submit_order`
20+
- Added optional `check_positon_exists` flag to `Strategy.submit_order`
21+
- Eliminated all use of `unsafe` Rust and C null-terminated byte strings
22+
- The `bypass_logging` config option will also now bypass the `BacktestEngine` logger
23+
24+
### Fixes
25+
- Fixed behaviour of `IOC` and `FOK` time in force instructions
26+
- Fixed Binance bar resolution parsing
27+
28+
---
29+
130
# NautilusTrader 1.143.0 Beta
231

332
Released on 21st April 2022 (UTC).
@@ -12,7 +41,6 @@ None
1241
- Fixed segfault for `CashAccount.calculate_balance_locked` with no base currency
1342
- Various FeatherWriter fixes
1443

15-
1644
---
1745

1846
# NautilusTrader 1.142.0 Beta

0 commit comments

Comments
 (0)