Welcome to FMZ Quant Trading Platform
Programming Languages
Key Security
Live Trading
Strategy Library
Docker
Exchange
Strategy Editor
Backtesting System
Backtesting System Modes
Impact of Backtest Data Granularity on Backtesting
The backtesting system supports multiple programming languages
Exchanges Supported by Backtesting System
Backtest System Parameter Optimization
Save Backtest Settings
Custom Data Source
Local Backtesting Engine
Backtest Page Shortcuts
Backtest Data Download
Backtest System Sharpe Ratio Algorithm
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
Rust
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 singlefn 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 anyuse/moddeclarations. API calls that may fail return aResult<T>type, which can be combined with the_C!macro for automatic retries.rustfn 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 tof64, booleans tobool, strings/passwords to&str, etc.), and can be referenced directly by parameter name; you can also use theparams()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:
Note: the compilation sandbox does not provide system OpenSSL, so for crates that require TLS (such as HTTP/WebSocket clients), please choose the pure-Rustrust--- [dependencies] serde_json = "1" --- fn main() { let v: serde_json::Value = serde_json::from_str(params()).unwrap(); Log!("Parameters:", v.to_string()); }rustlsimplementation (for example, enable therustls-tls-webpki-rootsfeature fortokio-tungstenite) and avoid depending onnative-tls/openssl-sys; for WebSocket connections, it is recommended to prefer the built-inDial()function, which requires no third-party crate. - Editor support
The strategy editor integratesrust-analyzerfor Rust strategies, providing code completion and real-time diagnostics.