Skip to content

Commit 8a1cbeb

Browse files
authored
1.103.0
2 parents c05f692 + b423699 commit 8a1cbeb

File tree

20 files changed

+155
-125
lines changed

20 files changed

+155
-125
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ The documentation for the latest version of the package is available at _readthe
9999

100100
## Installation
101101

102-
The latest version is tested against Python 3.7 - 3.9 on Linux and MacOS.
102+
The `master` branch will always reflect the code of the latest release version.
103+
Also, the documentation is always current for the latest version.
104+
105+
The package is tested against Python 3.7 - 3.9 on both Linux and MacOS.
103106

104107
We recommend users setup a virtual environment to isolate the dependencies, and run the platform
105108
with the latest stable version of Python.
@@ -239,7 +242,7 @@ at commit.
239242

240243
The following steps are for Unix-like systems, and only need to be completed once.
241244

242-
1. Install the pre-commit package:
245+
1. Install the `pre-commit` package by running:
243246

244247
pip install pre-commit
245248

@@ -255,7 +258,7 @@ The following steps are for Unix-like systems, and only need to be completed onc
255258

256259
poetry install
257260

258-
5. Setup the pre-commit hook which will then run automatically at commit:
261+
5. Setup the `pre-commit` hook which will then run automatically at commit by running:
259262

260263
pre-commit run --all-files
261264

docs/source/developer_guide/coding_standards.rst

+16-16
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ Coding Standards
33

44
Code Style
55
----------
6-
`Black` is a PEP-8 compliant opinionated formatter.
6+
``Black`` is a PEP-8 compliant opinionated formatter.
77

88
> https://github.com/psf/black
99

10-
We philosophically agree with the `Black` formatting style, however it does not
10+
We philosophically agree with the ``Black`` formatting style, however it does not
1111
currently run over Cython code. So you could say we are "handcrafting towards"
12-
`Blacks` stylistic conventions.
12+
``Blacks`` stylistic conventions.
1313

1414
The current codebase can be used as a guide for formatting guidance.
1515

16-
- For longer lines of code, and when passing more than a couple of arguments -
16+
- For longer lines of code, and when passing more than a couple of arguments
1717
it's common to take a new line which aligns at the next logical indent (rather
1818
than attempting a hanging alignment off an opening parenthesis).
1919

2020
- The closing parenthesis should be located on a new line, aligned at the logical
2121
indent.
2222

23-
- Also ensure multiple hanging parameters or arguments end with a comma `,`::
23+
- Also ensure multiple hanging parameters or arguments end with a comma::
2424

2525
LongCodeLine(
2626
some_arg1,
@@ -34,22 +34,22 @@ PEP-8
3434
The codebase generally follows the PEP-8 style guide.
3535

3636
One notable departure is that Python `truthiness` is not always taken advantage
37-
of to check if an argument is `None`, or if a collection is empty/has elements.
37+
of to check if an argument is ``None``, or if a collection is empty/has elements.
3838

3939
There are two reasons for this;
4040

41-
1- Cython can generate more efficient C code from `is None` and `is not None`,
42-
rather than entering the Python runtime to check the `PyObject` truthiness.
41+
1- Cython can generate more efficient C code from ``is None`` and ``is not None``,
42+
rather than entering the Python runtime to check the ``PyObject`` truthiness.
4343

4444
2- As per the `Google Python Style Guide` it's discouraged to use truthiness to
4545
check if an argument is/is not None, when there is a chance an unexpected object
4646
could be passed into the function or method which will yield an unexpected
4747
truthiness evaluation - which could result in a logical error type bug.
4848

49-
_"Always use if foo is None: (or is not None) to check for a None value.
49+
"Always use if foo is None: (or is not None) to check for a None value.
5050
E.g., when testing whether a variable or argument that defaults to None was set
5151
to some other value. The other value might be a value that’s false in a boolean
52-
context!"_
52+
context!"
5353

5454
> https://google.github.io/styleguide/pyguide.html
5555

@@ -64,22 +64,22 @@ NumPy Docstrings
6464
----------------
6565
The NumPy docstring syntax is used throughout the codebase. This needs to be
6666
adhered to consistently to ensure the docs build correctly during pushes to the
67-
`master` branch.
67+
``master`` branch.
6868

6969
> https://numpydoc.readthedocs.io/en/latest/format.html
7070

7171
Flake8
7272
------
73-
`flake8` is utilized to lint the codebase. Current ignores can be found in the
74-
`.flake8` config file, the majority of which are required so that valid Cython
73+
``flake8`` is utilized to lint the codebase. Current ignores can be found in the
74+
``.flake8`` config file, the majority of which are required so that valid Cython
7575
code is not picked up as flake8 failures.
7676

7777
Cython
7878
------
79-
Ensure that all functions and methods returning `void` or a primitive C type
80-
(such as `bint`, `int`, `double`) include the `except *` keyword in the signature.
79+
Ensure that all functions and methods returning ``void`` or a primitive C type
80+
(such as ``bint``, ``int``, ``double``) include the ``except *`` keyword in the signature.
8181

82-
This will ensure Python exceptions are not ignored, but instead are `bubbled up`
82+
This will ensure Python exceptions are not ignored, but instead are "bubbled up"
8383
to the caller as expected.
8484

8585
More information on Cython syntax and conventions can be found by reading the

docs/source/developer_guide/environment.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ For development we recommend using the PyCharm _Professional_ edition IDE, as it
55
interprets Cython syntax. Alternatively, you could use Visual Studio Code with
66
a Cython extension.
77

8-
`poetry` is the preferred tool for handling all Python package and dev dependencies.
8+
``poetry`` is the preferred tool for handling all Python package and dev dependencies.
99

1010
> https://python-poetry.org/
1111

12-
`pre-commit` is used to automatically run various checks, auto-formatters and linting tools
12+
``pre-commit`` is used to automatically run various checks, auto-formatters and linting tools
1313
at commit.
1414

1515
> https://pre-commit.com/
@@ -18,29 +18,29 @@ Setup
1818
-----
1919
The following steps are for Unix-like systems, and only need to be completed once.
2020

21-
1. Install pre-commit:
21+
1. Install ``pre-commit`` by running:
2222

2323
pip install pre-commit
2424

2525
2. Install the Cython package by running:
2626

2727
pip install -U Cython==3.0a6
2828

29-
3. Install `poetry` by running:
29+
3. Install ``poetry`` by running:
3030

3131
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
3232

3333
4. Then install all Python package dependencies, and compile the C extensions by running:
3434

3535
poetry install
3636

37-
5. Setup the pre-commit hook which will then run automatically at commit:
37+
5. Setup the ``pre-commit`` hook which will then run automatically at commit by running:
3838

3939
pre-commit run --all-files
4040

4141
Builds
4242
------
4343

44-
Following any changes to `.pyx` or `.pxd` files, you can re-compile by running:
44+
Following any changes to ``.pyx`` or ``.pxd`` files, you can re-compile by running:
4545

4646
python build.py

docs/source/developer_guide/packaged_data.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Packaged Data
22
=============
33

4-
Various data is contained internally in the `tests/test_kit/data` folder.
4+
Various data is contained internally in the ``tests/test_kit/data`` folder.
55

66
Libor Rates
77
-----------
88
The libor rates for 1 month USD can be updated by downloading the CSV data
99
from https://fred.stlouisfed.org/series/USD1MTD156N
1010

11-
Ensure you select `Max` for the time window.
11+
Ensure you select ``Max`` for the time window.
1212

1313
Short Term Interest Rates
1414
-------------------------

docs/source/developer_guide/testing.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ Tests can be run using either Pytest or the Nox tool.
1515
If you're using PyCharm then tests should run directly by right clicking on the
1616
respective folder (or top level tests folder) and clicking 'Run pytest'.
1717

18-
Alternatively you can use the `pytest .` command from the root level `tests`
18+
Alternatively you can use the ``pytest .`` command from the root level ``tests``
1919
folder, or the other sub folders.
2020

2121
Nox
2222
---
23-
Nox sessions are defined within the `noxfile.py`, to run various test collections.
23+
Nox sessions are defined within the ``noxfile.py``, to run various test collections.
2424

2525
To run unit tests with nox::
2626

2727
nox -s tests
2828

2929

30-
If you have `redis-server` up you can run integration tests with nox::
30+
If you have ``redis-server`` up you can run integration tests with nox::
3131

3232
nox -s integration_tests
3333

@@ -40,11 +40,11 @@ Mocks
4040
-----
4141
Unit tests will often include other components acting as mocks. The intent of
4242
this is to simplify the test suite to avoid extensive use of a mocking framework,
43-
although `MagicMock` objects are currently used in particular cases.
43+
although ``MagicMock`` objects are currently used in particular cases.
4444

4545
Code Coverage
4646
-------------
47-
Code coverage output is generated using `coverage` and reported using `codecov`.
47+
Code coverage output is generated using ``coverage`` and reported using ``codecov``.
4848

4949
High test coverage is a goal for the project however not at the expense of
5050
appropriate error handling, or causing "test induced damage" to the architecture.

docs/source/getting_started/core_concepts.rst

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Core Concepts
22
=============
33

4-
`NautilusTrader` has been built from the ground up to deliver the
4+
NautilusTrader has been built from the ground up to deliver the
55
highest quality performance and user experience.
66

77
There are two main use cases for this software package.
@@ -16,7 +16,7 @@ There are two main reasons for conducting backtests on historical data;
1616
- Verify the logic of trading strategy implementations
1717
- Getting an indication of likely performance **if the alpha of the strategy remains into the future**.
1818

19-
Backtesting with an event-driven engine such as `NautilusTrader` is not meant to be the primary
19+
Backtesting with an event-driven engine such as NautilusTrader is not meant to be the primary
2020
research method for alpha discovery, but merely facilitates the above.
2121

2222
One of the primary benefits of this platform is
@@ -27,18 +27,17 @@ endpoints through adapters provided with this package (and/or developed by end u
2727
This helps ensure consistency when seeking to capitalize on alpha through a large
2828
sample size of trades, as expressed in the logic of the trading strategies.
2929

30-
Only a small amount of example data is available in the `test`
31-
directory of the repository - as used in the examples. There are many sources of financial
32-
market data, and it is left to the user to supply this for backtesting
33-
purposes.
30+
Only a small amount of example data is available in the ``test`` directory of
31+
the repository - as used in the examples. There are many sources of financial
32+
market data, and it is left to the user to supply this for backtesting purposes.
3433

3534
The platform is extremely flexible and open ended, you could inject dozens of different
36-
datasets into a backtest engine, running them simulatenously with time being
37-
accurately simulated down to the smallest `timedelta` definable by Python.
35+
datasets into a backtest engine, running them simultaneously with time being
36+
accurately simulated down to the smallest ``timedelta`` definable by Python.
3837

3938
Trading Live
4039
------------
41-
A `TradingNode` is able to host a fleet of trading strategies,
40+
A ``TradingNode`` is able to host a fleet of trading strategies,
4241
with data able to be ingested from multiple data clients, and
4342
order execution and management through multiple execution clients.
4443

+40-12
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,58 @@
11
Installation
22
============
33

4+
The ``master`` branch will always reflect the code of the latest release version.
5+
Also, the documentation is always current for the latest version.
6+
47
The package is tested against Python versions 3.7 - 3.9 on both Linux and
58
MacOS. Users are encouraged to use the latest stable version of Python.
69

710
It is a goal for the project to keep dependencies focused, however there are
8-
still a large number of dependencies as found in the `pyproject.toml` file. Therefore we recommend you create a new
9-
virtual environment for `NautilusTrader`.
11+
still a large number of dependencies as found in the ``pyproject.toml`` file.
12+
Therefore we recommend you create a new virtual environment for NautilusTrader.
1013

11-
There are various ways of achieving this - the easiest being to use the `Poetry`
14+
There are various ways of achieving this - the easiest being to use the ``poetry``
1215
tool. https://python-poetry.org/docs/
1316

1417
If you're not used to working with virtual environments, you will find a great
15-
explanation in the `Poetry` documentation under the `Managing environments`
18+
explanation in the ``poetry`` documentation under the `Managing environments`
1619
sub-menu.
1720

18-
The latest version of `NautilusTrader` can be downloaded
19-
as a binary wheel from `PyPI`, just run::
21+
Installation for Unix-like systems can be achieved through `one` of the following options;
22+
23+
From PyPI
24+
---------
25+
26+
To install the latest binary wheel (or sdist package) from PyPI, run:
27+
28+
pip install -U nautilus_trader
29+
30+
From GitHub Release
31+
-------------------
32+
33+
To install a binary wheel from GitHub, first navigate to the latest release.
34+
35+
> https://github.com/nautechsystems/nautilus_trader/releases/latest/
36+
37+
Download the appropriate ``.whl`` for your operating system and Python version, then run::
38+
39+
pip install <file-name>.whl
40+
41+
From Source
42+
-----------
43+
44+
Installation from source requires Cython to compile the Python C extensions.
45+
46+
1. To install Cython, run::
2047

21-
pip install -U nautilus_trader
48+
pip install -U Cython==3.0a6
2249

50+
2. Then to install NautilusTrader using ``pip``, run::
2351

24-
Alternatively, you can install from source via pip by running::
52+
pip install -U git+https://github.com/nautechsystems/nautilus_trader
2553

26-
pip install .
54+
**Or** clone the source with ``git``, and install from the projects root directory by running::
2755

28-
The master branch will always reflect the code of the latest release version.
29-
Also, the documentation found here on `readthedocs` is always current for the
30-
latest version.
56+
git clone https://github.com/nautechsystems/nautilus_trader
57+
cd nautilus_trader
58+
pip install .

docs/source/user_guide/framework.rst

+8-10
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ architecture, allowing pluggable implementations of key components with a
1111
feature rich yet straight forward API. `Domain Driven Design` (DDD) and message passing
1212
have been central philosophies in the design.
1313

14-
From a high level
15-
view - a `Trader` can host any number of infinitely customizable
16-
`TradingStrategy`s. A central `Portfolio` has access to `Account`s which can all be queried. A common
17-
`DataEngine` and `ExecutionEngine` then allow asynchronous ingest of any data
18-
and trade events, with the core componentry common to both backtesting and live
19-
implementations.
14+
From a high level view - a ``Trader`` can host any number of infinitely customizable
15+
``TradingStrategy``s. A central ``Portfolio`` has access to ``Account``s which can all be queried.
16+
A common ``DataEngine`` and ``ExecutionEngine`` then allow asynchronous ingest of any data
17+
and trade events, with the core componentry common to both backtesting and live implementations.
2018

21-
Currently a performant `Redis` execution database maintains
22-
state persistence (swapped out for an in-memory only implementation for backtesting).
19+
Currently a performant Redis execution database maintains state persistence
20+
(swapped out for an in-memory only implementation for backtesting).
2321
It should be noted that the flexibility of the framework even allows the live trading
24-
`Redis` database to be plugged into the backtest engine. Interestingly there is
25-
only a 4x performance overhead which speaks to the raw speed of `Redis` and the
22+
Redis database to be plugged into the backtest engine. Interestingly there is
23+
only a 4x performance overhead which speaks to the raw speed of Redis and the
2624
platform itself.

0 commit comments

Comments
 (0)