Skip to content

Commit

Permalink
Release 1.136.0
Browse files Browse the repository at this point in the history
See release notes.
  • Loading branch information
cjdsellers authored Dec 29, 2021
2 parents 35baeda + fbf4684 commit 56be4f9
Show file tree
Hide file tree
Showing 96 changed files with 2,181 additions and 1,180 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.c
*.h
*.o
*.so
*.pyc
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: forbid-new-submodules
- id: fix-encoding-pragma
Expand Down Expand Up @@ -62,7 +62,7 @@ repos:
]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
rev: v0.930
hooks:
- id: mypy
args: [
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ clean:
rm -rf .nox
rm -rf .pytest_cache
rm -rf build
rm -rf cython_debug
rm -rf dist
rm -rf docs/build
find . -name dask-worker-space -type d -exec rm -rf {} +
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@

- **Website:** https://nautilustrader.io
- **Docs:** https://docs.nautilustrader.io
- **Support:** info@nautechsystems.io
- **Support:** [support@nautilustrader.io](mailto:support@nautilustrader.io)
- **Discord:** https://discord.gg/VXv6byZZ

## Introduction

NautilusTrader is an open-source, high-performance, production-grade algorithmic trading platform,
providing quantitative traders with the ability to backtest portfolios of automated trading strategies
on historical data with an event-driven engine, and also deploy those same strategies live.

The platform is AI-first, designed to deploy models for algorithmic trading strategies developed
The platform is 'AI-first', designed to deploy models for algorithmic trading strategies developed
using the Python ecosystem - within a highly performant and robust Python native environment.
This helps to address the challenge of keeping the research/backtest environment consistent with the production
live trading environment.
Expand Down
31 changes: 31 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
# NautilusTrader 1.136.0 Beta - Release Notes

Released 29th, December 2021

## Breaking Changes
- Changed `subscribe_data(...)` method (`client_id` now optional).
- Changed `unsubscribe_data(...)` method (`client_id` now optional).
- Changed `publish_data(...)` method (added `data_type`).
- Renamed `MessageBus.subscriptions` method param to `pattern`.
- Renamed `MessageBus.has_subscribers` method param to `pattern`.`
- Removed `subscribe_strategy_data(...)` method.
- Removed `unsubscribe_strategy_data(...)` method.
- Removed `publish_strategy_data(...)` method.
- Renamed `CryptoSwap` to `CryptoPerpetual`.

## Enhancements
- Can now modify or cancel in-flight orders live and backtest.
- Updated `CancelOrder` to allow None `venue_order_id`.
- Updated `ModifyOrder` to allow None `venue_order_id`.
- Updated `OrderPendingUpdate` to allow None `venue_order_id`.
- Updated `OrderPendingCancel` to allow None `venue_order_id`.
- Updated `OrderCancelRejected` to allow None `venue_order_id`.
- Updated `OrderModifyRejected` to allow None `venue_order_id`.
- Added `DataType.topic` string for improved message bus handling.

## Fixes
- Implemented comparisons for `DataType`, `BarSpecification` and `BarType`.
- Fixed `QuoteTickDataWrangler.process_bar_data` with `random_seed`.

---

# NautilusTrader 1.135.0 Beta - Release Notes

Released 13th, December 2021
Expand Down
35 changes: 16 additions & 19 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
from setuptools import Extension


# If DEBUG mode is enabled, skip compiler optimizations
# If DEBUG mode is enabled, include traces necessary for coverage, profiling and skip optimizations
DEBUG_MODE = bool(os.getenv("DEBUG_MODE", ""))
# If PROFILING mode is enabled, include traces necessary for coverage and profiling
PROFILING_MODE = bool(os.getenv("PROFILING_MODE", ""))
# If ANNOTATION mode is enabled, generate an annotated HTML version of the input source files
ANNOTATION_MODE = bool(os.getenv("ANNOTATION_MODE", ""))
# If PARALLEL build is enabled, uses all CPUs for compile stage of build
Expand All @@ -48,8 +46,8 @@
"language_level": "3",
"cdivision": True, # If division is as per C with no check for zero (35% speed up)
"embedsignature": True, # If docstrings should be embedded into C signatures
"profile": PROFILING_MODE, # If we're profiling, turn on line tracing
"linetrace": PROFILING_MODE,
"profile": DEBUG_MODE, # If we're debugging, turn on profiling
"linetrace": DEBUG_MODE, # If we're debugging, turn on line tracing
"warn.maybe_uninitialized": True,
}

Expand All @@ -60,12 +58,12 @@ def _build_extensions() -> List[Extension]:
# https://stackoverflow.com/questions/52749662/using-deprecated-numpy-api
# From the Cython docs: "For the time being, it is just a warning that you can ignore."
define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
if PROFILING_MODE or ANNOTATION_MODE:
if DEBUG_MODE or ANNOTATION_MODE:
# Profiling requires special macro directives
define_macros.append(("CYTHON_TRACE", "1"))

extra_compile_args = []
if platform.system() != "Windows":
if not DEBUG_MODE and platform.system() != "Windows":
extra_compile_args.append("-O3")
extra_compile_args.append("-pipe")

Expand All @@ -89,9 +87,9 @@ def _build_extensions() -> List[Extension]:
def _build_distribution(extensions: List[Extension]) -> Distribution:
# Build a Distribution using cythonize()
# Determine the build output directory
if PROFILING_MODE:
# For subsequent annotation, the C source needs to be in
# the same tree as the Cython code.
if DEBUG_MODE:
# For subsequent debugging, the C source needs to be in
# the same tree as the Cython code (not in a separate build directory).
build_dir = None
elif ANNOTATION_MODE:
build_dir = "build/annotated"
Expand All @@ -106,6 +104,7 @@ def _build_distribution(extensions: List[Extension]) -> Distribution:
compiler_directives=CYTHON_COMPILER_DIRECTIVES,
nthreads=os.cpu_count(),
build_dir=build_dir,
gdb_debug=DEBUG_MODE,
),
zip_safe=False,
)
Expand All @@ -130,7 +129,7 @@ def _copy_build_dir_to_project(cmd: build_ext) -> None:
print("Copied all compiled '.so' dynamic library files into source")


def build(setup_kwargs):
def build() -> None:
"""Construct the extensions and distribution.""" # noqa
# Create C Extensions to feed into cythonize()
extensions = _build_extensions()
Expand All @@ -144,10 +143,9 @@ def build(setup_kwargs):
cmd.ensure_finalized()
cmd.run()

# Copy the build back into the project for packaging
_copy_build_dir_to_project(cmd)

return setup_kwargs
if not SKIP_BUILD_COPY:
# Copy the build back into the project for development and packaging
_copy_build_dir_to_project(cmd)


if __name__ == "__main__":
Expand All @@ -156,7 +154,7 @@ def build(setup_kwargs):
print("Nautilus Builder")
print("=====================================================================\033[0m")

start_ts = datetime.utcnow()
ts_start = datetime.utcnow()

# Work around a Cython problem in Python 3.8.x on macOS
# https://github.com/cython/cython/issues/3262
Expand Down Expand Up @@ -184,12 +182,11 @@ def build(setup_kwargs):

print("Starting build...")
print(f"DEBUG_MODE={DEBUG_MODE}")
print(f"PROFILING_MODE={PROFILING_MODE}")
print(f"ANNOTATION_MODE={ANNOTATION_MODE}")
print(f"PARALLEL_BUILD={PARALLEL_BUILD}")
print(f"SKIP_BUILD_COPY={SKIP_BUILD_COPY}")
print("")

build({})
print(f"Build time: {datetime.utcnow() - start_ts}")
build()
print(f"Build time: {datetime.utcnow() - ts_start}")
print("\033[32m" + "Build completed" + "\033[0m")
10 changes: 6 additions & 4 deletions nautilus_trader/accounting/accounts/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ cdef class Account:

def __repr__(self) -> str:
cdef str base_str = self.base_currency.code if self.base_currency is not None else None
return (f"{type(self).__name__}("
f"id={self.id.value}, "
f"type={AccountTypeParser.to_str(self.type)}, "
f"base={base_str})")
return (
f"{type(self).__name__}("
f"id={self.id.value}, "
f"type={AccountTypeParser.to_str(self.type)}, "
f"base={base_str})"
)

# -- QUERIES ---------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion nautilus_trader/adapters/betfair/client/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, code: str, message: str):
self.kind = ERROR_CODES.get(message, {}).get("kind")
self.reason = ERROR_CODES.get(message, {}).get("reason")

def __str__(self):
def __str__(self) -> str:
return f"BetfairAPIError(code='{self.code}', message='{self.message}', kind='{self.kind}', reason='{self.reason}')"


Expand Down
2 changes: 1 addition & 1 deletion nautilus_trader/adapters/ftx/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
from nautilus_trader.model.identifiers import Venue


FTX_VENUE = Venue("FTX_VENUE")
FTX_VENUE = Venue("FTX")
2 changes: 1 addition & 1 deletion nautilus_trader/adapters/ftx/http/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ async def get_trades(self, market: str) -> dict:
url_path=f"markets/{market}/trades",
)

async def get_account_info(self) -> dict:
async def get_account_info(self) -> Dict[str, Any]:
return await self._sign_request(http_method="GET", url_path="account")

async def get_open_orders(self, market: str = None) -> List[dict]:
Expand Down
Loading

0 comments on commit 56be4f9

Please sign in to comment.