Skip to content

Getting Started

Loren1166 edited this page Sep 25, 2024 · 2 revisions

Getting Started 入门指南

To get started with NautilusTrader you will need the following:
开始使用 NautilusTrader,您需要具备以下条件:

  • A Python environment with the nautilus_trader package installed
    安装了 nautilus_trader 包的 Python 环境
  • A way to launch Python scripts for backtesting and/or live trading (either from the command line, or Jupyter notebook etc)
    一种启动 Python 脚本进行回测和/或实盘交易的方法(可以是命令行、Jupyter notebook 等)

Installation 安装指南

The Installation guide will help to ensure that NautilusTrader is properly installed on your machine.
安装指南将帮助确保在您的计算机上正确安装 NautilusTrader。

Quickstart 快速入门

The Quickstart provides a step-by-step walk through for setting up your first backtest.
快速入门提供逐步的指南,帮助您设置并运行首次回测。

Backtesting API levels 回测 API 级别

Backtesting involves running simulated trading systems on historical data.
回测包括在历史数据上运行模拟的交易系统。

To get started backtesting with NautilusTrader you need to first understand the two different API levels which are provided, and which one may be more suitable for your intended use case.
要开始使用 NautilusTrader 进行回测,首先需要了解平台提供的两种不同的 API 级别,以及哪种更适合您的使用场景。

info
提示
For more information on which API level to choose, refer to the Backtesting guide.
有关如何选择 API 级别的更多信息,请参阅回测指南。

Backtest (low-level API) 回测(低级 API)

This tutorial runs through how to load raw data (external to Nautilus) using data loaders and wranglers, and then use this data with a BacktestEngine to run a single backtest.
本教程介绍如何使用数据加载器和数据整理器加载原始数据(Nautilus 之外的数据),然后使用这些数据与 BacktestEngine 一起运行单次回测。

Backtest (high-level API) 回测(高级 API)

This tutorial runs through how to load raw data (external to Nautilus) into the data catalog, and then use this data with a BacktestNode to run a single backtest.
本教程介绍如何将原始数据(Nautilus 之外的数据)加载到数据目录中,然后使用这些数据与 BacktestNode 一起运行单次回测。

Running in docker 使用 Docker 运行

Alternatively, a self-contained dockerized Jupyter notebook server is available for download, which does not require any setup or installation. This is the fastest way to get up and running to try out NautilusTrader. Bear in mind that any data will be deleted when the container is deleted.
此外,可以下载一个自包含的 Docker 化 Jupyter notebook 服务器,该服务器不需要任何设置或安装。这是最快的方式来体验 NautilusTrader。请注意,当容器删除时,任何数据也会被删除。

To get started, install docker (要开始,请安装 Docker):

  1. Go to docker.com and follow the instructions
    访问 docker.com 并按照说明操作
  2. From a terminal, download the latest image
    在终端下载最新镜像:
    docker pull ghcr.io/nautechsystems/jupyterlab:nightly --platform linux/amd64
  3. Run the docker container, exposing the jupyter port:
    运行 Docker 容器,公开 Jupyter 端口:
    docker run -p 8888:8888 ghcr.io/nautechsystems/jupyterlab:nightly
  4. Open your web browser to localhost:{port}
    打开浏览器访问 localhost:{端口}
    https://localhost:8888
    

info
提示
NautilusTrader currently exceeds the rate limit for Jupyter notebook logging (stdout output), this is why log_level in the examples is set to ERROR. If you lower this level to see more logging then the notebook will hang during cell execution. A fix is currently being investigated which involves either raising the configured rate limits for Jupyter, or throttling the log flushing from Nautilus.
NautilusTrader 当前超出了 Jupyter notebook 日志记录(标准输出)的速率限制,因此示例中的 log_level 设置为 ERROR。如果您降低该级别以查看更多日志输出,notebook 在单元格执行期间可能会挂起。目前正在研究一种修复方法,涉及提高 Jupyter 的配置速率限制或减少 Nautilus 的日志刷新频率。


文档 (Documentation)
入门 (Getting Started)
概念 (Concepts)
教程 (Tutorials)
集成 (Integrations)
Python API
Rust API[未翻译]
开发者指南 (Developer Guide)
Clone this wiki locally