Type/to search
Welcome to FMZ Quant Trading Platform
Programming Languages
JavaScript
TypeScript
Python
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
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

  1. The main difference between writing strategies in C++ and JavaScript lies in the data returned by API functions on the FMZ Quant Trading Platform. For example, the exchange.GetTicker() function:
  • JavaScript
    exchange.GetTicker() returns an object when called successfully, and returns null if the call fails (e.g., exchange server issues, network problems, etc.).

    javascript
    function main() { var ticker = exchange.GetTicker() // Check if exchange.GetTicker function call failed and returned null if (ticker){ Log(ticker) } }
  • C++
    exchange.GetTicker() returns an object when called successfully, and still returns an object when the call fails. The objects returned from successful and failed calls are distinguished by the Valid property.

    c++
    void main() { auto ticker = exchange.GetTicker(); // Check if exchange.GetTicker() function call failed by checking if the Valid property in the returned object is false if (ticker.Valid) { Log(ticker); } }
  1. The difference between the main() function in C++ strategies and the main() function in standard C11:
    The entry function main() in C11 C++ programs returns an int type, while in FMZ Quant's C++ strategies, the strategy's startup function is also main(). However, these are not the same function, they just share the same name. The main() function in FMZ Quant's C++ strategies returns a void type.
c++
void main() { // Test using the Test function if (!Test("c++")) { // Throw an exception to terminate program execution Panic("Please download the latest version of the docker"); } // All returned objects use the Valid property to determine validity LogProfitReset(); LogReset(); Log(_N(9.12345, 2)); Log("use _C", _C(exchange.GetTicker), _C(exchange.GetAccount)); }