Type/to search
Getting Started
Welcome to FMZ Quant Trading Platform
Quick Start
Key Security
Platform Basics
Account and Billing
Live Robot Billing and Top-up
Sub-accounts
Exchange
General Protocol
Local Credential Files
Exchange-Specific Notes
Securities and Futures
Crypto
Docker
Strategy Library
Live Trading
Writing Strategies
Development Tools
Backtesting System
Advanced Topics
Data and Research
Integrations

Template libraries can also set their own interface parameters. Template library parameters are used as global variables in the template library code.

For example, we set a template library parameter:

Template Parameter

Variable Name in Strategy CodeParameter Name Displayed on Strategy InterfaceTypeDefault Value
param1Template Parameter 1Number99

Parameters of a Rust template are constants that can only be read, not modified, so in Rust the example below can only read the parameter:

rust
// template code pub fn GetParam1() -> f64 { Log!("param1:", param1); param1 }
rust
// strategy code fn main() { Log!("Calling ext::GetParam1:", ext::GetParam1()); }

Examples

  • Template library code for testing the param1 parameter:

    javascript
    $.SetParam1 = function(p1) { param1 = p1 } $.GetParam1 = function() { Log("param1:", param1) return param1 }
    python
    def SetParam1(p1): global param1 param1 = p1 def GetParam1(): Log("param1:", param1) return param1 ext.SetParam1 = SetParam1 ext.GetParam1 = GetParam1
    rust
    // Rust template parameters are read-only constants; see above for how to read them
  • Strategy code referencing the above template library example, using the template library's exported functions to get parameter param1 and modify parameter param1.

    javascript
    function main () { Log("Calling $.GetParam1:", $.GetParam1()) Log("Calling $.SetParam1:", "#FF0000") $.SetParam1(20) Log("Calling $.GetParam1:", $.GetParam1()) }
    python
    def main(): Log("Calling ext.GetParam1:", ext.GetParam1()) Log("Calling ext.SetParam1:", "#FF0000") ext.SetParam1(20) Log("Calling ext.GetParam1:", ext.GetParam1())
    rust
    // Rust template parameters are read-only constants; see above for how to read them