Skip to content

Commit

Permalink
Merge pull request #103 from nautechsystems/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
cjdsellers committed Oct 30, 2020
2 parents b9c6a09 + b25f536 commit e3ffa4b
Show file tree
Hide file tree
Showing 38 changed files with 437 additions and 569 deletions.
50 changes: 34 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,34 @@

## Introduction

NautilusTrader is a high-performance algorithmic trading platform allowing quantitative traders
the ability to backtest portfolios of automated trading strategies on historical
data with an event-driven engine, and also trade those strategies live in a
production grade environment. The project heavily utilizes Cython to provide
type safety and performance through C extension modules. The libraries can be
_NautilusTrader_ is an open-source, high-performance 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 trade those same strategies live in a
production grade environment.

The project heavily utilizes Cython, which provides
static type safety and performance through C extension modules. The libraries can be
accessed from both pure Python and Cython.

## Cython
Cython is a compiled programming language that aims to be a superset of the
Python programming language, designed to give C-like performance with code that
is written mostly in Python with optional additional C-inspired syntax.

> https://cython.org
To run code or tests from the source code, first compile the C extensions for the package.

$ python setup.py build_ext --inplace

## Documentation

The documentation for the latest version of the package is available on _readthedocs_.

> https://nautilus-trader.readthedocs.io
## Features

- **Fast:** C level speed and type safety provided through Cython. Asynchronous networking with uvloop.
- **Reliable:** Redis or Postgres backed performant state persistence for the live `ExecutionEngine`.
- **Flexible:** Any FIX or REST API can be integrated into the platform, with no changes to your strategy scripts.
- **Backtesting:** Multiple instruments and strategies simultaneously with historical tick and/or bar data.
- **Fast:** C level speed and type safety provided through Cython. Asynchronous networking utilizing uvloop.
- **Reliable:** Redis or Postgres backed performant state persistence for live implementations.
- **Flexible:** Any FIX, REST or WebSockets or API can be integrated into the platform.
- **Backtesting:** Multiple instruments and strategies simultaneously with historical quote tick, trade tick and bar data.
- **Multi-venue:** Multiple venue capabilities allows market making and statistical arbitrage strategies.
- **AI Agent Training:** Backtest engine fast enough to be used to train AI trading agents (RL/ES).

Expand All @@ -62,15 +63,32 @@ To run code or tests from the source code, first compile the C extensions for th

## Installation

Latest version;
The latest version can be installed via PyPI and is tested against
Python 3.6.x - 3.8.x on _Linux_ and _MacOS_.

$ pip install nautilus_trader

## Development

We recommend the PyCharm _Professional_ edition IDE as it interprets Cython syntax.

> https://www.jetbrains.com/pycharm/
To run code or tests from the source code, first compile the C extensions for the package.

$ python setup.py build_ext --inplace

Please refer to the _Developer Guide_ in the documentation for further details.

## Contributing

All forms of contribution are welcome. Please see the guide on how to contribute.
Involvement from the developer community is a goal for this project. All
are welcome to open issues/discussions on GitHub for proposed enhancements, feature
requests, and bug reports.

Please refer to the below.

[Contributing](CONTRIBUTING.md)
[CONTRIBUTING.md](CONTRIBUTING.md)

---

Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ pre-commit>=2.6.0
isort>=5.6.1
flake8>=3.8.4
sphinx>=1.8.5
sphinx-autoapi>=1.5.1
sphinx-rtd-theme>=0.5.0
numpydoc>=1.1.0
2 changes: 1 addition & 1 deletion docs/source/api_reference/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Decimal
:undoc-members:
:member-order: bysource

Finite State Machine (fsm)
Finite State Machine (FSM)
--------------------------------

.. automodule:: nautilus_trader.core.fsm
Expand Down
5 changes: 5 additions & 0 deletions docs/source/api_reference/trading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,8 @@ Trader
------

.. automodule:: nautilus_trader.trading.trader
:show-inheritance:
:inherited-members:
:members:
:undoc-members:
:member-order: bysource
2 changes: 0 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.coverage",
"sphinx.ext.graphviz",
"sphinx.ext.inheritance_diagram",
"numpydoc",
]

Expand Down
10 changes: 8 additions & 2 deletions nautilus_trader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
# limitations under the License.
# -------------------------------------------------------------------------------------------------

"""Define package location and version information."""
"""
The `trading` sub-package groups the core trading operations components.
This is a top level package where the majority of users will interface with the
framework. Custom trading strategies can be implemented by inheriting from the
`TradingStrategy` base class.
"""

import os

Expand All @@ -25,7 +31,7 @@
# Semantic Versioning (https://semver.org/)
_MAJOR_VERSION = 1
_MINOR_VERSION = 83
_PATCH_VERSION = 9
_PATCH_VERSION = 10
_PRE_RELEASE = ''

__version__ = '.'.join([
Expand Down
6 changes: 5 additions & 1 deletion nautilus_trader/adapters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
# limitations under the License.
# -------------------------------------------------------------------------------------------------

"""The `adapters` module provides integrations for data providers, brokerages, and exchanges."""
"""
The `adapters` module provides integrations for data providers, brokerages, and exchanges.
More description to follow.
"""
2 changes: 1 addition & 1 deletion nautilus_trader/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"""
The `analysis` sub-package groups components relating to trading performance statistics and analysis.
More description to follow (silence Codacy).
More description to follow.
"""
18 changes: 17 additions & 1 deletion nautilus_trader/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,20 @@
# limitations under the License.
# -------------------------------------------------------------------------------------------------

"""The `common` sub-package provides common parts for the platforms components."""
"""
The `common` sub-package provides common parts for the frameworks components.
More domain specific concepts are introduced above the `core` base layer. The
identifier cache is implemented, a base `Clock` with `Test` and `Live`
implementations which can control many `Timer` instances.
System level commands and enums.
The base `Component` class.
Trading domain specific components for generating `Order` and `Identifier` objects.
Common logging components.
Common `UUID` class.
"""
4 changes: 2 additions & 2 deletions nautilus_trader/common/enums.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Provides the C enums as Python enums for external use.
isort:skip_file
"""

from nautilus_trader.model.c_enums.component_state import ComponentState # noqa F401 (being used)
from nautilus_trader.model.c_enums.component_trigger import ComponentTrigger # noqa F401 (being used)
from nautilus_trader.common.c_enums.component_state import ComponentState # noqa F401 (being used)
from nautilus_trader.common.c_enums.component_trigger import ComponentTrigger # noqa F401 (being used)
11 changes: 10 additions & 1 deletion nautilus_trader/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,13 @@
# limitations under the License.
# -------------------------------------------------------------------------------------------------

"""The `core` sub-package groups core types, functions and components for the platform."""
"""
The `core` sub-package groups core constants, functions and components for the framework.
The main focus here is on efficiency and re-usability as this forms the base
layer of the entire framework. Message passing is a core design philosophy and
the message base types are contained here.
A generic `FiniteStateMachine` operates with C-level enums, ensuring correct
state transitions for both domain entities and common components.
"""
9 changes: 8 additions & 1 deletion nautilus_trader/core/cache.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
# limitations under the License.
# -------------------------------------------------------------------------------------------------

"""
Defines a generic object cache.
The intended use is to reduce the creation of duplicate objects such as
identifiers, which represent the same thing.
"""

from nautilus_trader.core.correctness cimport Condition


Expand Down Expand Up @@ -101,6 +108,6 @@ cdef class ObjectCache:

cpdef void clear(self) except *:
"""
Clears all cached values.
Clear all cached values.
"""
self._cache.clear()
8 changes: 7 additions & 1 deletion nautilus_trader/core/decimal.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ cdef class Decimal:
cdef readonly object _value

@staticmethod
cdef inline tuple _convert_values(object a, object b)
cdef inline object _extract_value(object obj)

@staticmethod
cdef inline bint _compare(a, b, int op) except *

@staticmethod
cdef inline double _eval_double(double a, double b, int op) except *

cpdef object as_decimal(self)
cpdef double as_double(self) except *
Loading

0 comments on commit e3ffa4b

Please sign in to comment.