Skip to content

Commit 981d8e2

Browse files
authored
Release 1.162.0
See release notes.
2 parents ad0f3f0 + 7608766 commit 981d8e2

File tree

91 files changed

+2313
-2828
lines changed

Some content is hidden

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

91 files changed

+2313
-2828
lines changed

.docker/nautilus_trader.dockerfile

Lines changed: 1 addition & 1 deletion
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.2.2 \
7+
POETRY_VERSION=1.3.0 \
88
POETRY_HOME="/opt/poetry" \
99
POETRY_VIRTUALENVS_CREATE=false \
1010
POETRY_NO_INTERACTION=1 \

.github/workflows/build.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
# Install build dependencies
4343
- name: Install build dependencies
44-
run: python -m pip install --upgrade pip setuptools wheel poetry nox pre-commit
44+
run: python -m pip install --upgrade pip setuptools wheel poetry pre-commit
4545

4646
# Setup cached pre-commit
4747
- name: Setup cached pre-commit
@@ -60,7 +60,7 @@ jobs:
6060
id: cached-poetry-dir
6161
run: echo "::set-output name=dir::$(poetry config cache-dir)"
6262

63-
- name: Poetry/Nox cache
63+
- name: Poetry cache
6464
id: cached-poetry
6565
uses: actions/cache@v3
6666
with:
@@ -100,14 +100,18 @@ jobs:
100100
# Run tests (Linux)
101101
- name: Run tests (Linux)
102102
if: runner.os == 'Linux'
103-
run: nox -rs tests_all
103+
run: make pytest
104104

105105
# Run tests (macOS)
106106
- name: Run tests (macOS)
107107
if: runner.os == 'macOS'
108-
run: nox -rs tests_all
108+
run: make pytest
109109

110110
# Run tests (Windows) without parallel build (avoids linker errors)
111111
- name: Run tests (Windows)
112112
if: runner.os == 'Windows'
113-
run: nox -rs tests_all -- no-parallel
113+
run: |
114+
poetry install --with test --extras "betfair docker ib redis"
115+
poetry run pytest --ignore=tests/performance_tests --new-first --failed-first
116+
env:
117+
PARALLEL_BUILD: false

.github/workflows/build_pr.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
# Install build dependencies
4343
- name: Install build dependencies
44-
run: python -m pip install --upgrade pip setuptools wheel poetry nox pre-commit
44+
run: python -m pip install --upgrade pip setuptools wheel poetry pre-commit
4545

4646
# Setup cached pre-commit
4747
- name: Setup cached pre-commit
@@ -60,7 +60,7 @@ jobs:
6060
id: cached-poetry-dir
6161
run: echo "::set-output name=dir::$(poetry config cache-dir)"
6262

63-
- name: Poetry/Nox cache
63+
- name: Poetry cache
6464
id: cached-poetry
6565
uses: actions/cache@v3
6666
with:
@@ -100,14 +100,18 @@ jobs:
100100
# Run tests (Linux)
101101
- name: Run tests (Linux)
102102
if: runner.os == 'Linux'
103-
run: nox -rs tests_all
103+
run: make pytest
104104

105105
# Run tests (macOS)
106106
- name: Run tests (macOS)
107107
if: runner.os == 'macOS'
108-
run: nox -rs tests_all
108+
run: make pytest
109109

110110
# Run tests (Windows) without parallel build (avoids linker errors)
111111
- name: Run tests (Windows)
112112
if: runner.os == 'Windows'
113-
run: nox -rs tests_all -- no-parallel
113+
run: |
114+
poetry install --with test --extras "betfair docker ib redis"
115+
poetry run pytest --ignore=tests/performance_tests --new-first --failed-first
116+
env:
117+
PARALLEL_BUILD: false

.github/workflows/coverage.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Install build dependencies
4141
- name: Install build dependencies
42-
run: python -m pip install --upgrade pip setuptools wheel poetry nox pre-commit
42+
run: python -m pip install --upgrade pip setuptools wheel poetry pre-commit
4343

4444
# Setup cached pre-commit
4545
- name: Setup cached pre-commit
@@ -58,7 +58,7 @@ jobs:
5858
id: cached-poetry-dir
5959
run: echo "::set-output name=dir::$(poetry config cache-dir)"
6060

61-
- name: Poetry/Nox cache
61+
- name: Poetry cache
6262
id: cached-poetry
6363
uses: actions/cache@v3
6464
with:
@@ -72,16 +72,14 @@ jobs:
7272
sudo apt-get install redis-server
7373
redis-server --daemonize yes
7474
75-
# Run tests (Linux)
76-
- name: Run tests (Linux)
77-
if: runner.os == 'Linux'
78-
run: nox -rs coverage
75+
# Run tests with coverage
76+
- name: Run tests with coverage
77+
run: make pytest-coverage
7978

8079
# Upload coverage report to codecov (Linux)
81-
- name: Upload coverage report (Linux)
82-
if: runner.os == 'Linux'
83-
uses: codecov/codecov-action@v1
80+
- name: Upload coverage report
81+
uses: codecov/codecov-action@v3
8482
with:
8583
token: ${{ secrets.CODECOV_TOKEN }}
86-
file: ./coverage.xml
84+
files: ./coverage.xml
8785
verbose: true

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ jobs:
4444
# Build docs (develop)
4545
- name: Build docs (develop)
4646
if: ${{ steps.branch-name.outputs.current_branch == 'develop' }}
47-
run: poetry run sphinx-build docs docs/build/html -b html
47+
run: make docs
4848

4949
# Build docs (latest)
5050
- name: Build docs (latest)
5151
if: ${{ steps.branch-name.outputs.current_branch == 'master' }}
52-
run: poetry run sphinx-build docs docs/build/html -b html
52+
run: make docs
5353

5454
# Add nojeckyll
5555
- name: Add nojeckyll

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
# Install build dependencies
4646
- name: Install build dependencies
47-
run: python -m pip install --upgrade pip setuptools wheel poetry nox pre-commit
47+
run: python -m pip install --upgrade pip setuptools wheel poetry pre-commit
4848

4949
# Test pip installation
5050
- name: Test pip installation
@@ -81,14 +81,14 @@ jobs:
8181

8282
# Install build dependencies
8383
- name: Install build dependencies
84-
run: python -m pip install --upgrade pip setuptools wheel poetry nox pre-commit
84+
run: python -m pip install --upgrade pip setuptools wheel poetry pre-commit
8585

8686
# Setup Poetry caching
8787
- name: Get Poetry cache dir
8888
id: cached-poetry-dir
8989
run: echo "::set-output name=dir::$(poetry config cache-dir)"
9090

91-
- name: Poetry/Nox cache
91+
- name: Poetry cache
9292
id: cached-poetry
9393
uses: actions/cache@v3
9494
with:
@@ -157,14 +157,14 @@ jobs:
157157

158158
# Install build dependencies
159159
- name: Install build dependencies
160-
run: python -m pip install --upgrade pip setuptools wheel poetry nox pre-commit
160+
run: python -m pip install --upgrade pip setuptools wheel poetry pre-commit
161161

162162
# Setup Poetry caching
163163
- name: Get Poetry cache dir
164164
id: cached-poetry-dir
165165
run: echo "::set-output name=dir::$(poetry config cache-dir)"
166166

167-
- name: Poetry/Nox cache
167+
- name: Poetry cache
168168
id: cached-poetry
169169
uses: actions/cache@v3
170170
with:
@@ -211,7 +211,7 @@ jobs:
211211
strategy:
212212
fail-fast: false
213213
matrix:
214-
arch: [x64, ARM64]
214+
arch: [x64]
215215
os: [ubuntu-latest, macos-latest, windows-latest]
216216
python-version: ["3.9", "3.10", "3.11"]
217217
name: publish-wheels - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
@@ -241,14 +241,14 @@ jobs:
241241

242242
# Install build dependencies
243243
- name: Install build dependencies
244-
run: python -m pip install --upgrade pip setuptools wheel poetry nox pre-commit
244+
run: python -m pip install --upgrade pip setuptools wheel poetry pre-commit
245245

246246
# Setup Poetry caching
247247
- name: Get Poetry cache dir
248248
id: cached-poetry-dir
249249
run: echo "::set-output name=dir::$(poetry config cache-dir)"
250250

251-
- name: Poetry/Nox cache
251+
- name: Poetry cache
252252
id: cached-poetry
253253
uses: actions/cache@v3
254254
with:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ repos:
6464
args: ["--settings-file", "pyproject.toml", "."]
6565

6666
- repo: https://github.com/psf/black
67-
rev: 22.10.0
67+
rev: 22.12.0
6868
hooks:
6969
- id: black
7070
types_or: [python, pyi]

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ EXTRAS?="betfair docker ib redis"
88
.PHONY: cargo-update cargo-test cargo-test-arm64
99
.PHONY: update docker-build docker-build-force docker-push
1010
.PHONY: docker-build-jupyter docker-push-jupyter
11+
.PHONY: pytest pytest-coverage
1112

1213
install:
1314
poetry install --extras ${EXTRAS}
1415

16+
install-dev:
17+
poetry install --with dev,test,docs --extras ${EXTRAS}
18+
19+
install-just-deps:
20+
poetry install --with dev,test,docs --extras ${EXTRAS} --no-root
21+
1522
build: nautilus_trader
1623
poetry run python build.py
1724

@@ -56,3 +63,9 @@ docker-build-jupyter:
5663

5764
docker-push-jupyter:
5865
docker push ${IMAGE}:jupyter
66+
67+
pytest:
68+
bash scripts/test.sh
69+
70+
pytest-coverage:
71+
bash scripts/test-coverage.sh

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,13 @@ point we will follow a formal process for releases, with deprecation periods for
207207
208208
A `Makefile` is provided to automate most installation and build tasks. It provides the following targets:
209209
- `make install` -- Installs the package using poetry
210+
- `make install-dev` -- Installs the package using poetry (including all dev and test dependencies)
210211
- `make build` -- Runs the Cython build script
211212
- `make clean` -- Cleans all non-source artifacts from the repository
212213
- `make docs` -- Builds the documentation HTML using Sphinx
213214
- `make pre-commit` -- Runs the pre-commit checks over all files
215+
- `make pytest` -- Ensures all test dependencies are installed and runs all tests with pytest (except performance)
216+
- `make pytest-coverage` -- Same as `make pytest` and additionally runs test coverage and produces a report
214217
215218
## Examples
216219

RELEASES.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
1+
# NautilusTrader 1.162.0 Beta
2+
3+
Released on 12th December 2022 (UTC).
4+
5+
### Breaking Changes
6+
- `OrderFactory` bracket order methods consolidated to `.bracket(...)`
7+
8+
### Enhancements
9+
- Extended `OrderFactory` to provide more bracket order types
10+
- Simplified GitHub CI and removed `nox` dependency
11+
12+
### Fixes
13+
- Fixed `OrderBook` sorting for bid side, thanks @gaugau3000
14+
- Fixed `MARKET_TO_LIMIT` order initial fill behaviour
15+
- Fixed `BollingerBands` indicator mid-band calculations, thanks zhp (Discord)
16+
17+
---
18+
119
# NautilusTrader 1.161.0 Beta
220

3-
Released on TBD (UTC).
21+
Released on 10th December 2022 (UTC).
422

523
### Breaking Changes
624
- Renamed `OrderFactory.bracket_market` to `OrderFactory.bracket_market_entry`
725
- Renamed `OrderFactory.bracket_limit` to `OrderFactory.bracket_limit_entry`
826
- Renamed `OrderFactory` bracket order `price` and `trigger_price` parameters
927

1028
### Enhancements
29+
- Added support for Python 3.11
1130
- Consolidated config objects to `msgspec` providing better performance and correctness
1231
- Added `OrderFactory.bracket_stop_limit_entry_stop_limit_tp(...)`
1332
- Numerous improvements to the Interactive Brokers adapter, thanks @limx0 and @rsmb7z
1433
- Removed dependency on `pydantic`
1534

1635
### Fixes
17-
- Fixed `STOP_MARKET` order behaviour to fill at market on immediate trigger
18-
- Fixed `STOP_LIMIT` order behaviour to fill at market on immediate trigger and marketable
19-
- Fixed `STOP_LIMIT` order behaviour to fill at market on processed trigger and marketable
20-
- Fixed `LIMIT_IF_TOUCHED` order behaviour to fill at market on immediate trigger and marketable
36+
- Fixed `STOP_MARKET` order behavior to fill at market on immediate trigger
37+
- Fixed `STOP_LIMIT` order behavior to fill at market on immediate trigger and marketable
38+
- Fixed `STOP_LIMIT` order behavior to fill at market on processed trigger and marketable
39+
- Fixed `LIMIT_IF_TOUCHED` order behavior to fill at market on immediate trigger and marketable
2140
- Fixed Binance start and stop time units for bar (kline) requests, thanks @Tzumx
2241
- `RiskEngineConfig.bypass` set to `True` will now correctly bypass throttlers, thanks @DownBadCapital
2342
- Fixed updating of emulated orders

docs/_static/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ dl.py.class {
228228
/*.md-nav__link--active .submenu {
229229
display: block;
230230
}*/
231+
.md-sidebar__inner .md-nav__link .pre {
232+
color: #fff;
233+
}
231234
.md-nav__link:hover/*,
232235
.md-nav__item.selected > .md-nav__link*/ {
233236
color: #00bdd6 !important;

docs/_templates/globaltoc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
</ul>
2525
</div>
2626
{# TODO: Fallback to toc? #}
27-
{% endif %}
27+
{% endif %}

docs/_templates/localtoc.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
{%- for item in toc_nodes recursive %}
99
<li class="md-nav__item"><a href="{{ item.href|e }}" class="md-nav__link">{{ item.contents }}</a>
1010
{%- if item.children -%}
11-
<nav class="md-nav">
12-
<ul class="md-nav__list">{{ loop(item.children) }}</ul>
13-
</nav>
11+
<span class="arrow">
12+
<i class="fa-solid fa-chevron-right"></i>
13+
</span>
14+
15+
<ul class="submenu"> {{ loop(item.children) }}</ul>
1416
{%- endif %}
1517
</li>
1618
{%- endfor %}
@@ -19,4 +21,4 @@
1921
{% include "sourcelink.html" %}
2022
{%- endif %}
2123
</ul>
22-
</nav>
24+
</nav>

docs/api_reference/accounting.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
.. automodule:: nautilus_trader.accounting
55
```
66

7-
## Cash Account
8-
97
```{eval-rst}
108
.. automodule:: nautilus_trader.accounting.accounts.cash
119
:show-inheritance:
@@ -14,8 +12,6 @@
1412
:member-order: bysource
1513
```
1614

17-
## Margin Account
18-
1915
```{eval-rst}
2016
.. automodule:: nautilus_trader.accounting.accounts.margin
2117
:show-inheritance:
@@ -24,8 +20,6 @@
2420
:member-order: bysource
2521
```
2622

27-
## Calculators
28-
2923
```{eval-rst}
3024
.. automodule:: nautilus_trader.accounting.calculators
3125
:show-inheritance:
@@ -34,8 +28,6 @@
3428
:member-order: bysource
3529
```
3630

37-
## Factory
38-
3931
```{eval-rst}
4032
.. automodule:: nautilus_trader.accounting.factory
4133
:show-inheritance:
@@ -44,8 +36,6 @@
4436
:member-order: bysource
4537
```
4638

47-
## Manager
48-
4939
```{eval-rst}
5040
.. automodule:: nautilus_trader.accounting.manager
5141
:show-inheritance:

0 commit comments

Comments
 (0)