docs/developer_guide/docs.md
This guide outlines the style conventions and best practices for writing documentation for NautilusTrader.
Most pages should fit one of four types (Divio documentation system). Mixing types in a single page makes it harder to read and harder to maintain.
| Type | Purpose | Section |
|---|---|---|
| Tutorial | Teach by walking through a task | tutorials/ |
| How‑to guide | Solve a specific problem | how_to/ |
| Explanation | Clarify design and architecture | concepts/ |
| Reference | Describe the machinery | api_reference/ |
Two sections are exceptions: getting_started/ is an onboarding path that
combines tutorial-style walkthroughs with setup instructions, and
integrations/ pages mix reference (capabilities, symbology) with how-to
content (setup, configuration) so each venue page is self-contained.
Standalone how-to content that is not venue-specific belongs in how_to/.
A tutorial says "do this, then this, then this." The author picks the path. A how-to guide says "here is how to achieve X." The reader already knows they want X. Keep these distinct:
When one type needs to reference another, link to it instead of inlining. For
example, a how-to guide that configures TradingNodeConfig should link to the
API reference for field definitions rather than listing them again.
|) vertically for better readability.| Order Type | Spot | Margin | USDT Futures | Coin Futures | Notes |
|------------------------|------|--------|--------------|--------------|-------------------------|
| `MARKET` | ✓ | ✓ | ✓ | ✓ | |
| `STOP_MARKET` | - | ✓ | ✓ | ✓ | Not supported for Spot. |
| `MARKET_IF_TOUCHED` | - | - | ✓ | ✓ | Futures only. |
✓ for supported features.- for unsupported features (not ✗ or other symbols).*Not supported*.*Not supported by <venue>*
for venue gaps, or *Not currently implemented* for adapter gaps.file_path::function_name or file_path::ClassName rather than line numbers, which become stale as code changes.We follow modern documentation conventions that prioritize readability and accessibility:
This convention aligns with industry standards used by major technology companies including Google Developer Documentation, Microsoft Docs, and Anthropic's documentation. It improves readability, reduces cognitive load, and is more accessible for international users and screen readers.
# NautilusTrader Developer Guide
## Getting started with Python
## Using the Binance adapter
## REST API implementation
## WebSocket data streaming
## Testing with pytest
-) for unordered list bullets; avoid * or + to keep the Markdown style consistent across the project.Use admonition blocks to highlight important information:
| Admonition | Purpose |
|---|---|
:::note | Supplementary context that clarifies but isn't essential. |
:::info | Important information the reader should be aware of. |
:::tip | Helpful suggestions or best practices. |
:::warning | Potential pitfalls or important caveats. |
:::danger | Critical issues that could cause data loss or system failure. |
Avoid overusing admonitions; too many diminish their impact.
The docs site (fumadocs) provides built-in MDX components available in all .md files.
No imports are needed.
Add tab="..." to consecutive fenced code blocks for language-specific or variant code examples.
List Rust before Python so Rust is the default (left-most) tab.
\`\`\`rust tab="Rust"
let params = Params::from([("close_position", true.into())]);
\`\`\`
\`\`\`python tab="Python"
strategy.submit_order(order, params={"close_position": True})
\`\`\`
Use Steps and Step for sequential procedures.
<Steps>
<Step>
Configure the adapter.
</Step>
<Step>
Start the trading node.
</Step>
</Steps>
Use Accordions and Accordion for collapsible content.
<Accordions>
<Accordion title="Advanced configuration">
Content here.
</Accordion>
</Accordions>
Use Files, Folder, and File for directory tree visualizations.
<Files>
<Folder name="src" defaultOpen>
<File name="main.rs" />
<File name="lib.rs" />
</Folder>
</Files>
Use Cards and Card for linked content grids.
<Cards>
<Card title="Getting started" href="/latest/getting_started" />
<Card title="Concepts" href="/latest/concepts" />
</Cards>
Use TypeTable for parameter or type documentation tables.