Skip to content

Commit 5ce9605

Browse files
authored
Release 1.168.0
See release notes.
2 parents f95e3c7 + e220b79 commit 5ce9605

Some content is hidden

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

49 files changed

+1188
-782
lines changed

.github/workflows/build.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,16 @@ jobs:
110110
# Run tests (Linux)
111111
- name: Run tests (Linux)
112112
if: runner.os == 'Linux'
113-
run: make pytest
113+
run: |
114+
make pytest
115+
make test-examples
114116
115117
# Run tests (macOS)
116118
- name: Run tests (macOS)
117119
if: runner.os == 'macOS'
118-
run: make pytest
120+
run: |
121+
make pytest
122+
make test-examples
119123
120124
# Run tests (Windows) without parallel build (avoids linker errors)
121125
- name: Run tests (Windows)

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ repos:
5656
types: [python]
5757

5858
- repo: https://github.com/pycqa/isort
59-
rev: 5.11.4
59+
rev: 5.12.0
6060
hooks:
6161
- id: isort
6262
types_or: [python, cython]

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,6 @@ pytest:
7171

7272
pytest-coverage:
7373
bash scripts/test-coverage.sh
74+
75+
test-examples:
76+
bash scripts/test-examples.sh

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ eliminating many classes of bugs at compile-time.
112112
The project increasingly utilizes Rust for core performance-critical components. Python language binding is handled through
113113
Cython, with static libraries linked at compile-time before the wheel binaries are packaged, so a user
114114
does not need to have Rust installed to run NautilusTrader. In the future as more Rust code is introduced,
115-
[PyO3](https://pyo3.rs/v0.15.1/) will be leveraged for easier Python bindings.
115+
[PyO3](https://pyo3.rs/latest/) will be leveraged for easier Python bindings.
116116

117117
## Architecture (data flow)
118118

RELEASES.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
1+
# NautilusTrader 1.168.0 Beta
2+
3+
Released on 29th January 2023 (UTC).
4+
5+
### Breaking Changes
6+
- Removed `Cache.clear_cache()` (redundant with the `.reset()` method)
7+
8+
### Enhancements
9+
- Added `Cache` `.add(...)` and `.get(...)` for general 'user/custom' objects (as bytes)
10+
- Added `CacheDatabase` `.add(...)` and `.load()` for general cache objects (as bytes)
11+
- Added `RedisCacheDatabase` `.add(...) `and `.load()` for general Redis persisted bytes objects (as bytes)
12+
- Added `Cache.actor_ids()`
13+
- Added `Actor` cached state saving and loading functionality
14+
- Improved logging for called action handlers when not overridden
15+
16+
### Fixes
17+
- Fixed configuration of loading and saving actor and strategy state
18+
19+
---
20+
121
# NautilusTrader 1.167.0 Beta
222

323
Released on 28th January 2023 (UTC).
424

525
### Breaking Changes
6-
- Rename `OrderBookData.update_id` to `sequence`
7-
- Rename `BookOrder.id` to `order_id`
26+
- Renamed `OrderBookData.update_id` to `sequence`
27+
- Renamed `BookOrder.id` to `order_id`
828

929
### Enhancements
10-
- Introduce Rust pyo3 based `ParquetReader` and `ParquetWriter`, thanks @twitu
30+
- Introduced Rust pyo3 based `ParquetReader` and `ParquetWriter`, thanks @twitu
1131
- Added `msgbus.is_subscribed` (to check if topic and handler already subscribed)
1232
- Simplified message type model and introduce CQRS-ish live messaging architecture
1333

examples/backtest/fx_ema_cross_audusd_bars_from_ticks.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from nautilus_trader.backtest.data.wranglers import QuoteTickDataWrangler
2424
from nautilus_trader.backtest.engine import BacktestEngine
2525
from nautilus_trader.backtest.engine import BacktestEngineConfig
26+
from nautilus_trader.backtest.modules import FXRolloverInterestConfig
2627
from nautilus_trader.backtest.modules import FXRolloverInterestModule
2728
from nautilus_trader.examples.strategies.ema_cross import EMACross
2829
from nautilus_trader.examples.strategies.ema_cross import EMACrossConfig
@@ -46,7 +47,8 @@
4647
# the data is coming from packaged test data.
4748
provider = TestDataProvider()
4849
interest_rate_data = provider.read_csv("short-term-interest.csv")
49-
fx_rollover_interest = FXRolloverInterestModule(rate_data=interest_rate_data)
50+
config = FXRolloverInterestConfig(interest_rate_data)
51+
fx_rollover_interest = FXRolloverInterestModule(config=config)
5052

5153
# Add a trading venue (multiple venues possible)
5254
SIM = Venue("SIM")

examples/backtest/fx_ema_cross_audusd_ticks.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from nautilus_trader.backtest.engine import BacktestEngine
2525
from nautilus_trader.backtest.engine import BacktestEngineConfig
2626
from nautilus_trader.backtest.models import FillModel
27+
from nautilus_trader.backtest.modules import FXRolloverInterestConfig
2728
from nautilus_trader.backtest.modules import FXRolloverInterestModule
2829
from nautilus_trader.examples.strategies.ema_cross import EMACross
2930
from nautilus_trader.examples.strategies.ema_cross import EMACrossConfig
@@ -56,7 +57,8 @@
5657
# the data is coming from packaged test data.
5758
provider = TestDataProvider()
5859
interest_rate_data = provider.read_csv("short-term-interest.csv")
59-
fx_rollover_interest = FXRolloverInterestModule(rate_data=interest_rate_data)
60+
config = FXRolloverInterestConfig(interest_rate_data)
61+
fx_rollover_interest = FXRolloverInterestModule(config=config)
6062

6163
# Add a trading venue (multiple venues possible)
6264
SIM = Venue("SIM")

examples/backtest/fx_ema_cross_bracket_gbpusd_bars_external.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from nautilus_trader.backtest.engine import BacktestEngine
2525
from nautilus_trader.backtest.engine import BacktestEngineConfig
2626
from nautilus_trader.backtest.models import FillModel
27+
from nautilus_trader.backtest.modules import FXRolloverInterestConfig
2728
from nautilus_trader.backtest.modules import FXRolloverInterestModule
2829
from nautilus_trader.config.common import RiskEngineConfig
2930
from nautilus_trader.examples.strategies.ema_cross_bracket import EMACrossBracket
@@ -53,7 +54,8 @@
5354
# the data is coming from packaged test data.
5455
provider = TestDataProvider()
5556
interest_rate_data = provider.read_csv("short-term-interest.csv")
56-
fx_rollover_interest = FXRolloverInterestModule(rate_data=interest_rate_data)
57+
config = FXRolloverInterestConfig(interest_rate_data)
58+
fx_rollover_interest = FXRolloverInterestModule(config=config)
5759

5860
# Create a fill model (optional)
5961
fill_model = FillModel(

examples/backtest/fx_ema_cross_bracket_gbpusd_bars_internal.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from nautilus_trader.backtest.engine import BacktestEngine
2525
from nautilus_trader.backtest.engine import BacktestEngineConfig
2626
from nautilus_trader.backtest.models import FillModel
27+
from nautilus_trader.backtest.modules import FXRolloverInterestConfig
2728
from nautilus_trader.backtest.modules import FXRolloverInterestModule
2829
from nautilus_trader.config.common import RiskEngineConfig
2930
from nautilus_trader.examples.strategies.ema_cross_bracket import EMACrossBracket
@@ -52,7 +53,8 @@
5253
# the data is coming from packaged test data.
5354
provider = TestDataProvider()
5455
interest_rate_data = provider.read_csv("short-term-interest.csv")
55-
fx_rollover_interest = FXRolloverInterestModule(rate_data=interest_rate_data)
56+
config = FXRolloverInterestConfig(interest_rate_data)
57+
fx_rollover_interest = FXRolloverInterestModule(config=config)
5658

5759
# Create a fill model (optional)
5860
fill_model = FillModel(

examples/backtest/fx_market_maker_gbpusd_bars.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from nautilus_trader.backtest.engine import BacktestEngine
2626
from nautilus_trader.backtest.engine import BacktestEngineConfig
2727
from nautilus_trader.backtest.models import FillModel
28+
from nautilus_trader.backtest.modules import FXRolloverInterestConfig
2829
from nautilus_trader.backtest.modules import FXRolloverInterestModule
2930
from nautilus_trader.examples.strategies.volatility_market_maker import VolatilityMarketMaker
3031
from nautilus_trader.examples.strategies.volatility_market_maker import VolatilityMarketMakerConfig
@@ -48,7 +49,8 @@
4849
# the data is coming from packaged test data.
4950
provider = TestDataProvider()
5051
interest_rate_data = provider.read_csv("short-term-interest.csv")
51-
fx_rollover_interest = FXRolloverInterestModule(rate_data=interest_rate_data)
52+
config = FXRolloverInterestConfig(interest_rate_data)
53+
fx_rollover_interest = FXRolloverInterestModule(config=config)
5254

5355
# Create a fill model (optional)
5456
fill_model = FillModel(

nautilus_core/Cargo.lock

+81-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nautilus_core/model/Cargo.toml

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ name = "nautilus_model"
1111
crate-type = ["rlib", "staticlib"]
1212

1313
[dependencies]
14+
derive_builder = "0.12.0"
1415
nautilus_core = { path = "../core" }
1516
pyo3.workspace = true
1617
rust-fsm.workspace = true
1718
strum.workspace = true
1819
thiserror.workspace = true
1920

2021
[features]
21-
extension-module = [
22-
"pyo3/extension-module",
23-
"nautilus_core/extension-module",
24-
]
22+
extension-module = ["pyo3/extension-module", "nautilus_core/extension-module"]
2523
default = []
2624

2725
[dev-dependencies]

0 commit comments

Comments
 (0)