Skip to content

Commit

Permalink
Update gh-pages to output generated at 5f31d43
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Mar 22, 2024
1 parent 13c43ae commit c08c509
Show file tree
Hide file tree
Showing 4,312 changed files with 8,510 additions and 868,187 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file modified .doctrees/api_reference/accounting.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/adapters/betfair.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/adapters/binance.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/adapters/interactive_brokers.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/analysis.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/backtest.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/cache.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/common.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/core.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/data.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/execution.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/indicators.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/live.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/model/book.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/model/data.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/model/events.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/model/identifiers.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/model/instruments.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/model/objects.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/model/orders.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/model/position.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/model/tick_scheme.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/persistence.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/portfolio.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/risk.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/serialization.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/system.doctree
Binary file not shown.
Binary file modified .doctrees/api_reference/trading.doctree
Binary file not shown.
Binary file modified .doctrees/concepts/data.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/integrations/databento.doctree
Binary file not shown.
Binary file modified .doctrees/integrations/ib.doctree
Binary file not shown.
Binary file modified .doctrees/integrations/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion _sources/concepts/data.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To achieve this, two main components are necessary:
### Data loaders

Data loader components are typically specific for the raw source/format and per integration. For instance, Binance order book data is stored in its raw CSV file form with
an entirely different format to [Databento Binary Encoding (DBN)](https://docs.databento.com/knowledge-base/new-users/dbn-encoding/getting-started-with-dbn) files.
an entirely different format to [Databento Binary Encoding (DBN)](https://databento.com/docs/knowledge-base/new-users/dbn-encoding/getting-started-with-dbn) files.

### Data wranglers

Expand Down
56 changes: 30 additions & 26 deletions _sources/integrations/databento.md.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Databento

```{warning}
We are currently working on this integration guide - consider it incomplete for now.
We are currently working on this integration guide.
```

NautilusTrader provides an adapter for integrating with the Databento API and [Databento Binary Encoding (DBN)](https://docs.databento.com/knowledge-base/new-users/dbn-encoding) format data.
NautilusTrader provides an adapter for integrating with the Databento API and [Databento Binary Encoding (DBN)](https://databento.com/docs/knowledge-base/new-users/dbn-encoding) format data.
As Databento is purely a market data provider, there is no execution client provided - although a sandbox environment with simulated execution could still be set up.
It's also possible to match Databento data with Interactive Brokers execution, or to calculate traditional asset class signals for crypto trading.

Expand All @@ -17,7 +17,7 @@ The capabilities of this adapter include:
[Databento](https://databento.com/signup) currently offers 125 USD in free data credits (historical data only) for new account sign-ups.

With careful requests, this is more than enough for testing and evaluation purposes.
It's recommended you make use of the [/metadata.get_cost](https://docs.databento.com/api-reference-historical/metadata/metadata-get-cost) endpoint.
It's recommended you make use of the [/metadata.get_cost](https://databento.com/docs/api-reference-historical/metadata/metadata-get-cost) endpoint.
```

## Overview
Expand All @@ -44,13 +44,13 @@ and won't need to necessarily work with these lower level components directly.

## Databento documentation

Databento provides extensive documentation for users which can be found in the [Databento knowledge base](https://docs.databento.com/knowledge-base/new-users).
It's recommended you also refer to the Databento documentation in conjunction with this Nautilus integration guide.
Databento provides extensive documentation for users which can be found in the [Databento knowledge base](https://databento.com/docs/knowledge-base/new-users).
It's recommended you also refer to this Databento documentation in conjunction with this NautilusTrader integration guide.

## Databento Binary Encoding (DBN)

Databento Binary Encoding (DBN) is an extremely fast message encoding and storage format for normalized market data.
The [DBN specification](https://docs.databento.com/knowledge-base/new-users/dbn-encoding) includes a simple, self-describing metadata header and a fixed set of struct definitions,
The [DBN specification](https://databento.com/docs/knowledge-base/new-users/dbn-encoding) includes a simple, self-describing metadata header and a fixed set of struct definitions,
which enforce a standardized way to normalize market data.

The integration provides a decoder which can convert DBN format data to Nautilus objects.
Expand Down Expand Up @@ -91,7 +91,7 @@ The Nautilus decoder will use the Databento `raw_symbol` for the Nautilus `symbo
from the Databento instrument definition message for the Nautilus `venue`.

Databento datasets are identified with a *dataset code* which is not the same
as a venue identifier. You can read more about Databento dataset naming conventions [here](https://docs.databento.com/api-reference-historical/basics/datasets).
as a venue identifier. You can read more about Databento dataset naming conventions [here](https://databento.com/docs/api-reference-historical/basics/datasets).

Of particular note is for CME Globex MDP 3.0 data (`GLBX.MDP3` dataset code), the following
exchanges are all grouped under the `GLBX` venue. These mappings can be determined from the
Expand All @@ -105,7 +105,7 @@ instruments `exchange` field:
- `XNYM` - **New York Mercantile Exchange (NYMEX)**

```{note}
Other venue MICs can be found in the `venue` field of responses from the [metadata.list_publishers](https://docs.databento.com/api-reference-historical/metadata/metadata-list-publishers?historical=http&live=python) endpoint.
Other venue MICs can be found in the `venue` field of responses from the [metadata.list_publishers](https://databento.com/docs/api-reference-historical/metadata/metadata-list-publishers?historical=http&live=python) endpoint.
```

## Timestamps
Expand All @@ -127,33 +127,37 @@ When decoding and normalizing Databento to Nautilus we generally assign the Data

```{note}
See the following Databento docs for further information:
- [Databento standards and conventions - timestamps](https://docs.databento.com/knowledge-base/new-users/standards-conventions/timestamps)
- [Databento timestamping guide](https://docs.databento.com/knowledge-base/data-integrity/timestamping/timestamps-on-databento-and-how-to-use-them)
- [Databento standards and conventions - timestamps](https://databento.com/docs/knowledge-base/new-users/standards-conventions/timestamps)
- [Databento timestamping guide](https://databento.com/docs/knowledge-base/data-integrity/timestamping/timestamps-on-databento-and-how-to-use-them)
```

## Data types

The following section discusses Databento schema -> Nautilus data type equivalence
and considerations.

```{note}
See the Databento [list of fields by schema guide](https://databento.com/docs/knowledge-base/new-users/fields-by-schema).
```

### Instrument definitions

Databento provides a single schema to cover all instrument classes, these are
decoded to the appropriate Nautilus `Instrument` types.

The following Databento instrument classes are supported by NautilusTrader:

| Databento instrument class | Nautilus instrument type |
|----------------------------|------------------------------|
| STOCK | `Equity` |
| FUTURE | `FuturesContract` |
| CALL | `OptionsContract` |
| PUT | `OptionsContract` |
| FUTURESPREAD | `FuturesSpread` |
| OPTIONSPREAD | `OptionsSpread` |
| MIXEDSPREAD | `OptionsSpread` |
| FXSPOT | `CurrencyPair` |
| BOND | Not yet available |
| Databento instrument class | Code | Nautilus instrument type |
|----------------------------|------|------------------------------|
| Stock | `K` | `Equity` |
| Future | `F` | `FuturesContract` |
| Call | `C` | `OptionsContract` |
| Put | `P` | `OptionsContract` |
| Future spread | `S` | `FuturesSpread` |
| Option spread | `T` | `OptionsSpread` |
| Mixed spread | `M` | `OptionsSpread` |
| FX spot | `X` | `CurrencyPair` |
| Bond | `B` | Not yet available |

### MBO (market by order)

Expand All @@ -171,9 +175,9 @@ object, which occurs during the replay startup sequence.

### MBP-1 (market by price, top-of-book)

This schema represents the top-of-book only. Like with MBO messages, some
This schema represents the top-of-book only (quotes *and* trades). Like with MBO messages, some
messages carry trade information, and so when decoding MBP-1 messages Nautilus
will produce a `QuoteTick` and also a `TradeTick` if the message is a trade.
will produce a `QuoteTick` and *also* a `TradeTick` if the message is a trade.

### OHLCV (bar aggregates)

Expand All @@ -183,9 +187,9 @@ The Nautilus decoder will normalize the `ts_event` timestamps to the **close** o

### Imbalance & Statistics

The Databento `imbalance` and `statistics` schemas cannot be represented as a built-in Nautilus data types
The Databento `imbalance` and `statistics` schemas cannot be represented as a built-in Nautilus data types,
and so they have specific types defined in Rust `DatabentoImbalance` and `DatabentoStatistics`.
Python bindings are provided via pyo3 (Rust) and so the types behaves a little differently to a built-in Nautilus
Python bindings are provided via pyo3 (Rust) so the types behave a little differently to a built-in Nautilus
data types, where all attributes are pyo3 provided objects and not directly compatible
with certain methods which may expect a Cython provided type. There are pyo3 -> legacy Cython
object conversion methods available, which can be found in the API reference.
Expand Down Expand Up @@ -244,7 +248,7 @@ the Nautilus Parquet data from disk, which achieves extremely high through-put (
than converting DBN -> Nautilus on the fly for every backtest run).

```{note}
Performance benchmarks are under development.
Performance benchmarks are currently under development.
```

## Loading DBN data
Expand Down
12 changes: 6 additions & 6 deletions _sources/integrations/ib.md.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Interactive Brokers

Interactive Brokers (IB) is a trading platform that allows trading across a wide range of financial instruments, including stocks, options, futures, currencies, bonds, funds, and cryptocurrencies. NautilusTrader offers an adapter to integrate with IB using their [Trader Workstation (TWS) API](https://interactivebrokers.github.io/tws-api/index.html) through their Python library, [ibapi](https://github.com/nautechsystems/ibapi).
Interactive Brokers (IB) is a trading platform that allows trading across a wide range of financial instruments, including stocks, options, futures, currencies, bonds, funds, and cryptocurrencies. NautilusTrader offers an adapter to integrate with IB using their [Trader Workstation (TWS) API](https://ibkrcampus.com/ibkr-api-page/trader-workstation-api/) through their Python library, [ibapi](https://github.com/nautechsystems/ibapi).

The TWS API serves as an interface to IB's standalone trading applications: TWS and IB Gateway. Both can be downloaded from the IB website. If you haven't installed TWS or IB Gateway yet, refer to the [Initial Setup](https://interactivebrokers.github.io/tws-api/initial_setup.html) guide. In NautilusTrader, you'll establish a connection to one of these applications via the `InteractiveBrokersClient`.
The TWS API serves as an interface to IB's standalone trading applications: TWS and IB Gateway. Both can be downloaded from the IB website. If you haven't installed TWS or IB Gateway yet, refer to the [Initial Setup](https://ibkrcampus.com/ibkr-api-page/trader-workstation-api/#tws-download) guide. In NautilusTrader, you'll establish a connection to one of these applications via the `InteractiveBrokersClient`.

Alternatively, you can start with a [dockerized version](https://github.com/gnzsnz/ib-gateway-docker) of the IB Gateway, particularly useful when deploying trading strategies on a hosted cloud platform. This requires having [Docker](https://www.docker.com/) installed on your machine, along with the [docker](https://pypi.org/project/docker/) Python package, which NautilusTrader conveniently includes as an extra package.
Alternatively, you can start with a [dockerized version](https://github.com/gnzsnz/ib-gateway-docker) of the IB Gateway, which is particularly useful when deploying trading strategies on a hosted cloud platform. This requires having [Docker](https://www.docker.com/) installed on your machine, along with the [docker](https://pypi.org/project/docker/) Python package, which NautilusTrader conveniently includes as an extra package.

```{note}
The standalone TWS and IB Gateway applications necessitate manual input of username, password, and trading mode (live or paper) at startup. The dockerized version of the IB Gateway handles these steps programmatically.
The standalone TWS and IB Gateway applications require manually inputting username, password, and trading mode (live or paper) at startup. The dockerized version of the IB Gateway handles these steps programmatically.
```

## Installation
Expand Down Expand Up @@ -87,7 +87,7 @@ To troubleshoot TWS API incoming message issues, consider starting at the `Inter

## Instruments & Contracts

In IB, a NautilusTrader `Instrument` is equivalent to a [Contract](https://interactivebrokers.github.io/tws-api/contracts.html). Contracts can be either a [basic contract](https://interactivebrokers.github.io/tws-api/classIBApi_1_1Contract.html) or a more [detailed](https://interactivebrokers.github.io/tws-api/classIBApi_1_1ContractDetails.html) version (ContractDetails). The adapter models these using `IBContract` and `IBContractDetails` classes. The latter includes critical data like order types and trading hours, which are absent in the basic contract. As a result, `IBContractDetails` can be converted to an `Instrument` while `IBContract` cannot.
In IB, a NautilusTrader `Instrument` is equivalent to a [Contract](https://ibkrcampus.com/ibkr-api-page/trader-workstation-api/#contracts). Contracts can be either a [basic contract](https://ibkrcampus.com/ibkr-api-page/trader-workstation-api/#contract-object) or a more [detailed](https://ibkrcampus.com/ibkr-api-page/trader-workstation-api/#contract-details) version (ContractDetails). The adapter models these using `IBContract` and `IBContractDetails` classes. The latter includes critical data like order types and trading hours, which are absent in the basic contract. As a result, `IBContractDetails` can be converted to an `Instrument` while `IBContract` cannot.

To search for contract information, use the [IB Contract Information Center](https://pennies.interactivebrokers.com/cstools/contract_info/).

Expand Down Expand Up @@ -195,7 +195,7 @@ instrument_provider_config = InteractiveBrokersInstrumentProviderConfig(

### Data Client

`InteractiveBrokersDataClient` interfaces with IB for streaming and retrieving market data. Upon connection, it configures the [market data type](https://interactivebrokers.github.io/tws-api/market_data_type.html) and loads instruments based on the settings in `InteractiveBrokersInstrumentProviderConfig`. This client can subscribe to and unsubscribe from various market data types, including quote ticks, trade ticks, and bars.
`InteractiveBrokersDataClient` interfaces with IB for streaming and retrieving market data. Upon connection, it configures the [market data type](https://ibkrcampus.com/ibkr-api-page/trader-workstation-api/#delayed-market-data) and loads instruments based on the settings in `InteractiveBrokersInstrumentProviderConfig`. This client can subscribe to and unsubscribe from various market data types, including quote ticks, trade ticks, and bars.

Configurable through `InteractiveBrokersDataClientConfig`, it allows adjustments for handling revised bars, trading hours preferences, and market data types (e.g., `IBMarketDataTypeEnum.REALTIME` or `IBMarketDataTypeEnum.DELAYED_FROZEN`).

Expand Down
23 changes: 12 additions & 11 deletions _sources/integrations/index.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,30 @@
binance.md
databento.md
ib.md

```

NautilusTrader is designed in a modular way to work with 'adapters' which provide
connectivity to data providers and/or trading venues - converting their raw API
NautilusTrader is designed in a modular way to work with *adapters* which provide
connectivity to trading venues and data providers - converting their raw API
into a unified interface. The following integrations are currently supported:

```{warning}
The initial integrations for the project are currently under heavy construction.
It's advised to conduct some of your own testing with small amounts of capital before
running strategies which are able to access larger capital allocations.
```

| Name | ID | Type | Status | Docs |
| :-------------------------------------------------------- | :-------------------- | :---------------------- | :------------------------------------------------------ | :------------------------------------------------------------------ |
| [Betfair](https://betfair.com) | `BETFAIR` | Sports Betting Exchange | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/betfair.html) |
| [Betfair](https://betfair.com) | `BETFAIR` | Sports Betting Exchange | ![status](https://img.shields.io/badge/stable-green) | [Guide](https://docs.nautilustrader.io/integrations/betfair.html) |
| [Binance](https://binance.com) | `BINANCE` | Crypto Exchange (CEX) | ![status](https://img.shields.io/badge/stable-green) | [Guide](https://docs.nautilustrader.io/integrations/binance.html) |
| [Binance US](https://binance.us) | `BINANCE` | Crypto Exchange (CEX) | ![status](https://img.shields.io/badge/stable-green) | [Guide](https://docs.nautilustrader.io/integrations/binance.html) |
| [Binance Futures](https://www.binance.com/en/futures) | `BINANCE` | Crypto Exchange (CEX) | ![status](https://img.shields.io/badge/stable-green) | [Guide](https://docs.nautilustrader.io/integrations/binance.html) |
| [Bybit](https://www.bybit.com) | `BYBIT` | Crypto Exchange (CEX) | ![status](https://img.shields.io/badge/building-orange) | |
| [Databento](https://databento.com) | `DATABENTO` | Data provider | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/databento.html) |
| [Databento](https://databento.com) | `DATABENTO` | Data Provider | ![status](https://img.shields.io/badge/beta-yellow) | [Guide](https://docs.nautilustrader.io/integrations/databento.html) |
| [Interactive Brokers](https://www.interactivebrokers.com) | `INTERACTIVE_BROKERS` | Brokerage (multi-venue) | ![status](https://img.shields.io/badge/stable-green) | [Guide](https://docs.nautilustrader.io/integrations/ib.html) |

- `ID:` The default client ID for the integrations adapter clients
- `Type:` The type of integration (often the venue type)

### Status
- `building` - Under construction and likely not in a usable state
- `beta` - Completed to a minimally working state and in a 'beta' testing phase
- `stable` - Stabilized feature set and API, the integration has been tested by both developers and users to a reasonable level (some bugs may still remain)

## Implementation goals

The primary goal of NautilusTrader is to provide a unified trading system for
Expand Down
2 changes: 1 addition & 1 deletion api_reference/adapters/interactive_brokers.html
Original file line number Diff line number Diff line change
Expand Up @@ -12080,7 +12080,7 @@ <h2 id="module-nautilus_trader.adapters.interactive_brokers.config">
at
</span>
<span class="pre">
0x7b3d5dc12f50&gt;
0x7ff537b77610&gt;
</span>
<span class="pre">
=
Expand Down
Loading

0 comments on commit c08c509

Please sign in to comment.