Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Oct 14, 2023
1 parent 5c1e22e commit 423c767
Show file tree
Hide file tree
Showing 11 changed files with 220 additions and 140 deletions.
4 changes: 2 additions & 2 deletions docs/api_reference/adapters/betfair.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
:member-order: bysource
```

## Historic
## OrderBook

```{eval-rst}
.. automodule:: nautilus_trader.adapters.betfair.historic
.. automodule:: nautilus_trader.adapters.betfair.orderbook
:show-inheritance:
:inherited-members:
:members:
Expand Down
10 changes: 5 additions & 5 deletions docs/concepts/advanced/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ highest to lowest level (although they are self-contained and can be read in any

Explore more advanced concepts of NautilusTrader through these guides:

- [Custom/Generic data](/docs/concepts/advanced/custom_data.md)
- [Advanced Orders](/docs/concepts/advanced/advanced_orders.md)
- [Emulated Orders](/docs/concepts/advanced/emulated_orders.md)
- [Synthetic Instruments](/docs/concepts/advanced/synthetic_instruments.md)
- [Portfolio Statistics](/docs/concepts/advanced/portfolio_statistics.md)
- [Custom/Generic data](custom_data.md)
- [Advanced Orders](advanced_orders.md)
- [Emulated Orders](emulated_orders.md)
- [Synthetic Instruments](synthetic_instruments.md)
- [Portfolio Statistics](portfolio_statistics.md)
2 changes: 1 addition & 1 deletion docs/concepts/architecture.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Architecture

Welcome to the architectural overview of NautilusTrader.
This document dives deep into the foundational principles, structures, and designs that underpin
This guide dives deep into the foundational principles, structures, and designs that underpin
the platform. Whether you're a developer, system architect, or just curious about the inner workings
of NautilusTrader, this exposition covers:

Expand Down
59 changes: 40 additions & 19 deletions docs/concepts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,58 @@

Welcome to NautilusTrader!


Explore the foundational concepts of NautilusTrader through the following guides.

```{note}
It's important to note that the [API Reference](../api_reference/index.md) documentation should be
considered the source of truth for the platform. If there are any discrepancies between concepts described here
and the API Reference, then the API Reference should be considered the correct information. We are
working to ensure that concepts stay up-to-date with the API Reference and will be introducing
doc tests in the near future to help with this.
```{note}
The terms "NautilusTrader", "Nautilus" and "platform" are used interchageably throughout the documentation.
```

## Guides
## [Overview](overview.md)
The **Overview** guide covers the main use cases for the platform.

## [Architecture](architecture.md)
The **Architecture** guide dives deep into the foundational principles, structures, and designs that underpin
the platform. Whether you're a developer, system architect, or just curious about the inner workings
of NautilusTrader.

## [Strategies](strategies.md)
The heart of the NautilusTrader user experience is in writing and working with
trading strategies. The **Strategies** guide covers how to implement trading strategies for the platform.

## [Instruments](instruments.md)
The `Instrument` base class represents the core specification for any tradable asset/contract.

## [Orders](orders.md)
The **Orders** guide provides more details about the available order types for the platform, along with
the execution instructions supported for each.

Explore the core concepts of NautilusTrader through these guides:
## [Execution](execution.md)
NautilusTrader can handle trade execution and order management for multiple strategies and venues
simultaneously (per instance). Several interacting components are involved in execution, making it
crucial to understand the possible flows of execution messages (commands and events).

### Fundamentals
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Strategies](strategies.md)
## [Backtesting](backtesting.md)
Backtesting with NautilusTrader is a methodical simulation process that replicates trading
activities using a specific system implementation.

### Trading essentials
- [Instruments](instruments.md)
- [Orders](orders.md)
- [Execution](execution.md)
- [Backtesting](backtesting.md)
## [Data](data.md)
The NautilusTrader platform defines a range of built-in data types crafted specifically to represent
a trading domain

### Data & integrations
- [Data](data.md)
- [Adapters](adapters.md)
## [Adapters](adapters.md)
The NautilusTrader design allows for integrating data publishers and/or trading venues
through adapter implementations, these can be found in the top level `adapters` subpackage.

### Utilities
- [Logging](logging.md)
## [Logging](logging.md)
The platform provides logging for both backtesting and live trading using a high-performance logger implemented in Rust.

### Advanced topics
- [Advanced](advanced/index.md)
## [Advanced](advanced/index.md)
Here you will find more detailed documentation and examples covering the more advanced
features and functionality of the platform.
24 changes: 15 additions & 9 deletions docs/getting_started/index.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# Getting Started

Welcome to the NautilusTrader getting started guide!

We recommend you first review the [installation](installation.md) guide to ensure that NautilusTrader
is properly installed on your machine.

Then read through the [quick start](quick_start.md) guide.

```{eval-rst}
.. toctree::
:maxdepth: 2
:glob:
:titlesonly:
:hidden:
introduction.md
installation.md
quick_start.md
```
quickstart.md
```

Welcome to the NautilusTrader getting started section!

## [Introduction](introduction.md)
The **Introduction** covers the value proposition for the platform and why NautilusTrader exists, as
well as a very high-level summary of the main features.

## [Installation](installation.md)
The **Installation** guide will help to ensure that NautilusTrader is properly installed on your machine.

## [Quickstart](quickstart.md)
The **Quickstart** provides a step-by-step walk through for setting up your first backtest.
102 changes: 102 additions & 0 deletions docs/getting_started/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Introduction

Welcome to NautilusTrader!

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, with no code changes.

The platform is 'AI-first', designed to develop and deploy algorithmic trading strategies within a highly performant
and robust Python native environment. This helps to address the parity challenge of keeping the Python research/backtest
environment, consistent with the production live trading environment.

NautilusTraders design, architecture and implementation philosophy holds software correctness and safety at the
highest level, with the aim of supporting Python native, mission-critical, trading system backtesting
and live deployment workloads.

The platform is also universal and asset class agnostic - with any REST, WebSocket or FIX API able to be integrated via modular
adapters. Thus, it can handle high-frequency trading operations for any asset classes
including FX, Equities, Futures, Options, CFDs, Crypto and Betting - across multiple venues simultaneously.

## Features

- **Fast:** C-level speed through Rust and Cython. Asynchronous networking with [uvloop](https://github.com/MagicStack/uvloop)
- **Reliable:** Type safety through Rust and Cython. Redis backed performant state persistence
- **Flexible:** OS independent, runs on Linux, macOS, Windows. Deploy using Docker
- **Integrated:** Modular adapters mean any REST, WebSocket, or FIX API can be integrated
- **Advanced:** Time in force `IOC`, `FOK`, `GTD`, `AT_THE_OPEN`, `AT_THE_CLOSE`, advanced order types and conditional triggers. Execution instructions `post-only`, `reduce-only`, and icebergs. Contingency order lists including `OCO`, `OTO`
- **Backtesting:** Run with multiple venues, instruments and strategies simultaneously using historical quote tick, trade tick, bar, order book and custom data with nanosecond resolution
- **Live:** Use identical strategy implementations between backtesting and live deployments
- **Multi-venue:** Multiple venue capabilities facilitate market making and statistical arbitrage strategies
- **AI Agent Training:** Backtest engine fast enough to be used to train AI trading agents (RL/ES)

![Nautilus](https://github.com/nautechsystems/nautilus_trader/blob/develop/docs/_images/nautilus-art.png?raw=true "nautilus")
> *nautilus - from ancient Greek 'sailor' and naus 'ship'.*
>
> *The nautilus shell consists of modular chambers with a growth factor which approximates a logarithmic spiral.
> The idea is that this can be translated to the aesthetics of design and architecture.*
## Why NautilusTrader?

- **Highly performant event-driven Python** - native binary core components
- **Parity between backtesting and live trading** - identical strategy code
- **Reduced operational risk** - risk management functionality, logical correctness and type safety
- **Highly extendable** - message bus, custom components and actors, custom data, custom adapters

Traditionally, trading strategy research and backtesting might be conducted in Python (or other suitable language)
using vectorized methods, with the strategy then needing to be reimplemented in a more event-drive way
using C++, C#, Java or other statically typed language(s). The reasoning here is that vectorized backtesting code cannot
express the granular time and event dependent complexity of real-time trading, where compiled languages have
proven to be more suitable due to their inherently higher performance, and type safety.

One of the key advantages of NautilusTrader here, is that this reimplementation step is now circumvented - as the critical core components of the platform
have all been written entirely in Rust or Cython. This means we're using the right tools for the job, where systems programming languages compile performant binaries,
with CPython C extension modules then able to offer a Python native environment, suitable for professional quantitative traders and trading firms.

## Why Python?

Python was originally created decades ago as a simple scripting language with a clean straight
forward syntax. It has since evolved into a fully fledged general purpose object-oriented
programming language. Based on the TIOBE index, Python is currently the most popular programming language in the world.
Not only that, Python has become the _de facto lingua franca_ of data science, machine learning, and artificial intelligence.

The language out of the box is not without its drawbacks however, especially in the context of
implementing large performance-critical systems. Cython has addressed a lot of these issues, offering all the advantages
of a statically typed language, embedded into Pythons rich ecosystem of software libraries and
developer/user communities.

## What is Cython?

[Cython](https://cython.org) 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.

The project heavily utilizes Cython to provide static type safety and increased performance
for Python through [C extension modules](https://docs.python.org/3/extending/extending.html). The vast majority of the production code is actually
written in Cython, however the libraries can be accessed from both Python and Cython.

## What is Rust?

[Rust](https://www.rust-lang.org/) is a multi-paradigm programming language designed for performance and safety, especially safe
concurrency. Rust is blazingly fast and memory-efficient (comparable to C and C++) with no runtime or
garbage collector. It can power mission-critical systems, run on embedded devices, and easily
integrates with other languages.

Rust’s rich type system and ownership model guarantees memory-safety and thread-safety deterministically —
eliminating many classes of bugs at compile-time.

The project increasingly utilizes Rust for core performance-critical components. Python language binding is handled through
Cython, with static libraries linked at compile-time before the wheel binaries are packaged, so a user
does not need to have Rust installed to run NautilusTrader. In the future as more Rust code is introduced,
[PyO3](https://pyo3.rs/latest) will be leveraged for easier Python bindings.

## Architecture Quality Attributes

- Reliability
- Performance
- Modularity
- Testability
- Maintainability
- Deployability

![Architecture](https://github.com/nautechsystems/nautilus_trader/blob/develop/docs/_images/architecture-overview.png?raw=true "architecture")
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Quick Start
# Quickstart

This guide explains how to get up and running with NautilusTrader backtesting with some
FX data. The Nautilus maintainers have pre-loaded some test data using the standard Nautilus persistence
format (Parquet) for this guide.

For more details on how to load data into Nautilus, see [Backtest Example](../guides/backtest_example.md).
For more details on how to load data into Nautilus, see the [Backtest](../tutorials/backtest_high_level.md) tutorial.

## Running in docker
A self-contained dockerized jupyter notebook server is available for download, which does not require any setup or
Expand Down
Loading

0 comments on commit 423c767

Please sign in to comment.