Type/to search
Welcome to FMZ Quant Trading Platform
Programming Languages
JavaScript
TypeScript
Python
Rust
C++
MyLanguage
PINE Language
Blockly Visual Programming
Workflow
Key Security
Live Trading
Strategy Library
Docker
Deploy Docker
One-Click Docker Rental
Manual Deployment of Bot
Docker Operation Precautions
Global IP Address Specification
Command Line Parameters for Bot Program
Live Trading Data Migration
Docker Monitor
Exchange
Strategy Editor
Backtesting System
Strategy Entry Functions
Strategy Framework and API Functions
Template Library
Strategy Parameters
Interactive Controls
Options Trading
Rust Strategy Development Guide
C++ Strategy Writing Guide
JavaScript Strategy Writing Guide
Web3
Built-in Libraries
Extended API Interface
MCP Service
Trading Terminal
Data Explorer
Alpha Factor Analysis Tool
General Protocol
Debugging Tool
Remote Editing
Import and Export of Complete Strategies
Multi-language Support
Live Trading and Strategy Grouping
Live Trading Display
Strategy Sharing and Renting
Live Trading Message Push
Common Causes of Live Trading Errors and Abnormal Exits
Exchange-Specific Notes

The platform supports writing strategies using the Rust programming language. Rust strategies run on a compile-first, then-execute basis: during backtesting, the strategy code is compiled by the platform server and runs in the backtesting system on the browser side; in live trading, Rust strategies run on the docker host after passing compilation.

Leveraging Rust's ownership model and static type system, you can write trading strategies that are both memory-safe and high-performance on the FMZ Quant trading platform.

  • Automatic injection of platform APIs
    The strategy code only needs a single fn main() entry function. All platform APIs (exchange, exchanges, TA, Log!/LogStatus!, _G!/_C!, etc.) are automatically injected via the prelude and can be called directly without any use/mod declarations. API calls that may fail return a Result<T> type, which can be combined with the _C! macro for automatic retries.
    rust
    fn main() { // GetTicker returns Result<Ticker>; use the _C! macro to retry until the call succeeds let ticker = _C!(exchange.GetTicker(None)); Log!("Last:", ticker.Last); }
  • Strategy parameters injected as global constants
    Strategy parameters configured in the interface are injected into the strategy as global constants, whose Rust types are determined by the actual value of the parameter (numbers map to f64, booleans to bool, strings/passwords to &str, etc.), and can be referenced directly by parameter name; you can also use the params() function to obtain the parameter set as JSON text and parse it yourself.
  • Third-party crate support
    The strategy source is the only code file (there is no separate Cargo.toml). You can declare dependencies at the top of the source using cargo-script-style frontmatter, which is automatically merged into Cargo.toml at build time:
    rust
    --- [dependencies] serde_json = "1" --- fn main() { let v: serde_json::Value = serde_json::from_str(params()).unwrap(); Log!("Parameters:", v.to_string()); }
    Note: the compilation sandbox does not provide system OpenSSL, so for crates that require TLS (such as HTTP/WebSocket clients), please choose the pure-Rust rustls implementation (for example, enable the rustls-tls-webpki-roots feature for tokio-tungstenite) and avoid depending on native-tls/openssl-sys; for WebSocket connections, it is recommended to prefer the built-in Dial() function, which requires no third-party crate.
  • Editor support
    The strategy editor integrates rust-analyzer for Rust strategies, providing code completion and real-time diagnostics.