Skip to content

Commit a0de1b0

Browse files
authored
Release 1.174.0
See release notes.
2 parents e13b080 + 4387144 commit a0de1b0

File tree

338 files changed

+5896
-3146
lines changed

Some content is hidden

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

338 files changed

+5896
-3146
lines changed

.codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ coverage:
88
status:
99
project:
1010
default:
11-
target: "90"
11+
target: "89"
1212
patch:
1313
default:
1414
target: "50"

.docker/nautilus_trader.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ WORKDIR $PYSETUP_PATH
1616
FROM base as builder
1717

1818
# Install build deps
19-
RUN apt-get update && apt-get install -y curl clang
19+
RUN apt-get update && apt-get install -y curl clang pkg-config libssl-dev
2020

2121
# Install Rust stable
2222
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

.pre-commit-config.yaml

+11-10
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,6 @@ repos:
6666
name: add-trailing-comma
6767
types: [python]
6868

69-
- repo: https://github.com/pycqa/isort
70-
rev: 5.12.0
71-
hooks:
72-
- id: isort
73-
types_or: [python, cython]
74-
entry: "isort"
75-
args: ["--settings-file", "pyproject.toml"]
76-
7769
- repo: https://github.com/psf/black
7870
rev: 23.3.0
7971
hooks:
@@ -84,13 +76,22 @@ repos:
8476
exclude: "docs/_pygments/monokai.py"
8577

8678
- repo: https://github.com/charliermarsh/ruff-pre-commit
87-
rev: v0.0.264
79+
rev: v0.0.269
8880
hooks:
8981
- id: ruff
9082
args: ["--fix"]
9183

84+
- repo: https://github.com/pycqa/isort
85+
rev: 5.12.0
86+
hooks:
87+
- id: isort
88+
name: isort (cython)
89+
types_or: [cython]
90+
entry: "isort"
91+
args: ["--settings-file", "pyproject.toml"]
92+
9293
- repo: https://github.com/pre-commit/mirrors-mypy
93-
rev: v1.2.0
94+
rev: v1.3.0
9495
hooks:
9596
- id: mypy
9697
args: [

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ install-debug:
1616
BUILD_MODE=debug poetry install --with dev,test --all-extras
1717

1818
install-just-deps:
19-
poetry install --with dev,test --all-extras --no-root
19+
poetry install --with dev,test --all-extras --no-root --sync
2020

2121
install-just-deps-all:
2222
poetry install --with dev,test,docs --all-extras --no-root
@@ -47,7 +47,7 @@ update:
4747
poetry update
4848

4949
clippy:
50-
(cd nautilus_core && cargo clippy --all-targets --all-features -- -D warnings -W clippy::pedantic -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used)
50+
(cd nautilus_core && cargo clippy --fix --all-targets --all-features -- -D warnings -W clippy::pedantic -W clippy::nursery -W clippy::unwrap_used -W clippy::expect_used)
5151

5252
cargo-build:
5353
(cd nautilus_core && cargo build --release --all-features)

RELEASES.md

+25
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# NautilusTrader 1.174.0 Beta
2+
3+
Released on 19th May 2023 (UTC).
4+
5+
### Breaking Changes
6+
- Parquet schemas are now shifting towards catalog v2 (we recommend you don't upgrade if using legacy catalog)
7+
- Moved order book data from `model.orderbook.data` into the `model.data.book` namespace
8+
9+
### Enhancements
10+
- Improved handling for backtest account blow-up scenarios (balance negative or margin exceeded)
11+
- Added `AccountMarginExceeded` exception and refined `AccountBalanceNegative`
12+
- Various improvements to `Binance` clients error handling and logging
13+
- Improve Binance HTTP error messages
14+
15+
### Fixes
16+
- Fixed handling of emulated order contingencies (not based on status of spawned algorithm orders)
17+
- Fixed sending execution algorithm commands from strategy
18+
- Fixed `OrderEmulator` releasing of already closed orders
19+
- Fixed `MatchingEngine` processing of reduce only for child contingency orders
20+
- Fixed `MatchingEngine` position ID assignment for child contingency orders
21+
- Fixed `Actor` handling of historical data from requests (will now call `on_historical_data` regardless of state), thanks for reporting @miller-moore
22+
- Fixed pyarrow schema dictionary index keys being too narrow (int8 -> int16), thanks for reporting @rterbush
23+
24+
---
25+
126
# NautilusTrader 1.173.0 Beta
227

328
Released on 5th May 2023 (UTC).

build.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
# If ANNOTATION mode is enabled, generate an annotated HTML version of the input source files
2727
ANNOTATION_MODE = bool(os.getenv("ANNOTATION_MODE", ""))
2828
# If PARALLEL build is enabled, uses all CPUs for compile stage of build
29-
PARALLEL_BUILD = True if os.getenv("PARALLEL_BUILD", "true") == "true" else False
29+
PARALLEL_BUILD = os.getenv("PARALLEL_BUILD", "true") == "true"
3030
# If COPY_TO_SOURCE is enabled, copy built *.so files back into the source tree
31-
COPY_TO_SOURCE = True if os.getenv("COPY_TO_SOURCE", "true") == "true" else False
31+
COPY_TO_SOURCE = os.getenv("COPY_TO_SOURCE", "true") == "true"
3232
# If PyO3 only then don't build C extensions to reduce compilation time
33-
PYO3_ONLY = False if os.getenv("PYO3_ONLY", "") == "" else True
33+
PYO3_ONLY = os.getenv("PYO3_ONLY", "") != ""
3434

3535
if PROFILE_MODE:
3636
# For subsequent debugging, the C source needs to be in the same tree as
@@ -189,17 +189,17 @@ def _build_distribution(extensions: list[Extension]) -> Distribution:
189189
print(f"nthreads={nthreads}")
190190

191191
distribution = Distribution(
192-
dict(
193-
name="nautilus_trader",
194-
ext_modules=cythonize(
192+
{
193+
"name": "nautilus_trader",
194+
"ext_modules": cythonize(
195195
module_list=extensions,
196196
compiler_directives=CYTHON_COMPILER_DIRECTIVES,
197197
nthreads=nthreads,
198198
build_dir=BUILD_DIR,
199199
gdb_debug=PROFILE_MODE,
200200
),
201-
zip_safe=False,
202-
),
201+
"zip_safe": False,
202+
},
203203
)
204204
return distribution
205205

@@ -280,7 +280,7 @@ def _strip_unneeded_symbols() -> None:
280280
else:
281281
raise RuntimeError(f"Cannot strip symbols for platform {platform.system()}")
282282
subprocess.run(
283-
strip_cmd, # noqa
283+
strip_cmd,
284284
check=True,
285285
shell=True, # noqa
286286
capture_output=True,

docs/api_reference/model/data.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
:member-order: bysource
1313
```
1414

15+
```{eval-rst}
16+
.. automodule:: nautilus_trader.model.data.book
17+
:show-inheritance:
18+
:inherited-members:
19+
:members:
20+
:member-order: bysource
21+
```
22+
1523
```{eval-rst}
1624
.. automodule:: nautilus_trader.model.data.bet
1725
:show-inheritance:

docs/api_reference/model/orderbook.md

-8
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@
1212
:member-order: bysource
1313
```
1414

15-
```{eval-rst}
16-
.. automodule:: nautilus_trader.model.orderbook.data
17-
:show-inheritance:
18-
:inherited-members:
19-
:members:
20-
:member-order: bysource
21-
```
22-
2315
```{eval-rst}
2416
.. automodule:: nautilus_trader.model.orderbook.ladder
2517
:show-inheritance:

examples/backtest/betfair_backtest_orderbook_imbalance.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
engine.add_instrument(instruments[1])
7070

7171
# Add data
72-
raw = [msg for msg in BetfairDataProvider.market_updates()]
72+
raw = list(BetfairDataProvider.market_updates())
7373
parser = BetfairParser()
7474
updates = [upd for update in raw for upd in parser.parse(update)]
7575
engine.add_data(updates, client_id=ClientId("BETFAIR"))
@@ -88,7 +88,7 @@
8888
engine.add_strategies(strategies)
8989

9090
time.sleep(0.1)
91-
input("Press Enter to continue...") # noqa (always Python 3)
91+
input("Press Enter to continue...")
9292

9393
# Run the engine (from start to end of data)
9494
engine.run()

examples/backtest/crypto_ema_cross_ethusdt_trade_ticks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
oms_type=OmsType.NETTING,
5050
account_type=AccountType.CASH, # Spot CASH account (not for perpetuals or futures)
5151
base_currency=None, # Multi-currency account
52-
starting_balances=[Money(1_000_000, USDT), Money(10, ETH)],
52+
starting_balances=[Money(1_000_000.0, USDT), Money(10.0, ETH)],
5353
)
5454

5555
# Add instruments
@@ -82,7 +82,7 @@
8282
engine.add_exec_algorithm(exec_algorithm)
8383

8484
time.sleep(0.1)
85-
input("Press Enter to continue...") # noqa (always Python 3)
85+
input("Press Enter to continue...")
8686

8787
# Run the engine (from start to end of data)
8888
engine.run()

examples/backtest/crypto_ema_cross_ethusdt_trailing_stop.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
engine.add_strategy(strategy=strategy)
7979

8080
time.sleep(0.1)
81-
input("Press Enter to continue...") # noqa (always Python 3)
81+
input("Press Enter to continue...")
8282

8383
# Run the engine (from start to end of data)
8484
engine.run()

examples/backtest/fx_ema_cross_audusd_bars_from_ticks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
engine.add_strategy(strategy=strategy)
8585

8686
time.sleep(0.1)
87-
input("Press Enter to continue...") # noqa (always Python 3)
87+
input("Press Enter to continue...")
8888

8989
# Run the engine (from start to end of data)
9090
engine.run()

examples/backtest/fx_ema_cross_audusd_ticks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
engine.add_strategy(strategy=strategy)
9797

9898
time.sleep(0.1)
99-
input("Press Enter to continue...") # noqa (always Python 3)
99+
input("Press Enter to continue...")
100100

101101
# Run the engine (from start to end of data)
102102
engine.run()

examples/backtest/fx_ema_cross_bracket_gbpusd_bars_external.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
engine.add_strategy(strategy=strategy)
119119

120120
time.sleep(0.1)
121-
input("Press Enter to continue...") # noqa (always Python 3)
121+
input("Press Enter to continue...")
122122

123123
# Run the engine (from start to end of data)
124124
engine.run()

examples/backtest/fx_ema_cross_bracket_gbpusd_bars_internal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
engine.add_strategy(strategy=strategy)
106106

107107
time.sleep(0.1)
108-
input("Press Enter to continue...") # noqa (always Python 3)
108+
input("Press Enter to continue...")
109109

110110
# Run the engine (from start to end of data)
111111
engine.run()

examples/backtest/fx_market_maker_gbpusd_bars.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
engine.add_strategy(strategy=strategy)
101101

102102
time.sleep(0.1)
103-
input("Press Enter to continue...") # noqa (always Python 3)
103+
input("Press Enter to continue...")
104104

105105
# Run the engine (from start to end of data)
106106
engine.run(end=datetime(2012, 2, 10))

examples/live/betfair_sandbox.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ async def main(market_id: str):
101101
node.run()
102102
# try:
103103
# node.start()
104-
# except Exception as ex:
105-
# print(ex)
104+
# except Exception as e:
105+
# print(e)
106106
# print(traceback.format_exc())
107107
# finally:
108108
# node.dispose()

0 commit comments

Comments
 (0)