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

  • Futu Securities
    Supports Futu Niuniu live trading and simulated (paper) trading. You need to download the FutuOpenD software.
    When using FutuOpenD to access simulated trading, some stock codes are not supported and therefore cannot be traded; however, the Futu Niuniu mobile APP supports simulated trading.
    For operations such as configuring the exchange object on the FMZ Quant platform and running the FutuOpenD software, please refer to the Futu Securities Configuration Documentation.

    • Interface Call Frequency
      The GetOrder, GetOrders, GetPositions, and GetAccount functions use cached data by default, so there is no call frequency limit.
      When new data is available, FutuOpenD will automatically update the data, and the cached data will be synchronized accordingly.

      Calling the exchange.IO("refresh", true) function can disable the cache; after disabling the cache, the call frequency is limited to a maximum of 10 queries within every 30 seconds, and exceeding this frequency limit will report an error.

    • Stock Codes
      For example: 600519.SH

      • HK Hong Kong stocks
      • US US stocks
      • SH Shanghai stocks
      • SZ Shenzhen stocks

      Use the exchange.SetContractType() function in the strategy code to set the stock code, for example:

      javascript
      function main() { var info = exchange.SetContractType("600519.SH") // Set to stock 600519.SH (Moutai), account switches to mainland market Log(info) Log(exchange.GetAccount()) // Current stock is Moutai, calling GetAccount function gets account assets for mainland market Log(exchange.GetTicker()) // Get current price information for Moutai stock }
      python
      def main(): info = exchange.SetContractType("600519.SH") Log(info) Log(exchange.GetAccount()) Log(exchange.GetTicker())
      rust
      fn main() { let info = exchange.SetContractType("600519.SH"); // Set to stock 600519.SH (Moutai), account switches to mainland market Log!(info); Log!(exchange.GetAccount()); // Current stock is Moutai, calling GetAccount function gets account assets for mainland market Log!(exchange.GetTicker(None)); // Get current price information for Moutai stock }
      c++
      void main() { auto info = exchange.SetContractType("600519.SH"); Log(info); Log(exchange.GetAccount()); Log(exchange.GetTicker()); }

      The function for setting the trading direction exchange.SetDirection, the order placement functions exchange.Buy/exchange.Sell,
      the order cancellation function exchange.CancelOrder, the order query function exchange.GetOrder, etc., are all used in the same way as in the futures market.

    • Account Information Data Format:
      Use TrdMarket to define the market, in order to distinguish between the Hong Kong market, US market, and Mainland market.

      Excerpted from the Futu API documentation:

      const ( TrdMarket_TrdMarket_Unknown TrdMarket = 0 //Unknown market TrdMarket_TrdMarket_HK TrdMarket = 1 //Hong Kong market TrdMarket_TrdMarket_US TrdMarket = 2 //US market TrdMarket_TrdMarket_CN TrdMarket = 3 //Mainland market TrdMarket_TrdMarket_HKCC TrdMarket = 4 //Hong Kong Stock Connect market TrdMarket_TrdMarket_Futures TrdMarket = 5 //Futures market )

      To obtain account information data, the exchange.GetAccount() function returns:

      json
      { "Info": [{ "Header": { ... // Omitted "TrdMarket": 1 // Market ID in Info raw data, indicates account assets for Hong Kong market trading }, "Funds": { // Account asset information in this market ... } }, ...], "Stocks": 0, "FrozenStocks": 0, "Balance": 1000000, // Asset value in current market "FrozenBalance": 0 }
    • FutuOpenD distinguishes regions based on the logged-in IP address
      Accounts logged in with a non-Mainland IP address will be restricted when obtaining market data. For details, please refer to the official FutuOpenD (Futu) documentation.

  • Interactive Brokers
    Configure the exchange:
    To use Interactive Brokers, you need to run the "IB Gateway" or "TWS (Trader Workstation)" software in the system environment where the docker (hosting node) is located. Here we take the "TWS" software as an example. After running "TWS" and logging in, click the configuration button in the upper right corner of the software to open the software configuration interface.

    • Select: "Configuration" -> "API" -> "Settings", do not check the "Read-Only API" option, and you need to check the "Enable ActiveX and Socket Clients" option; note the "Socket port" in the configuration (the default TWS port is 7496 for live / 7497 for simulation).
    • On the platform's add exchange page "https://www.fmz.com/m/platforms/add", select Interactive Brokers, and configure the parameters. In the "Server Address" configuration item, fill in the address corresponding to the "TWS" software (such as 127.0.0.1 or localhost) and the port, for example: localhost:7496.

    Supported markets:

    • Currently only the US stock market is supported; other markets such as futures and forex are not yet supported.
    • Example of US stock market stock code format:
      The stock code of Apple Inc. on the NASDAQ exchange: AAPL.US.
      The stock code of Tesla, Inc. on the NASDAQ exchange: TSLA.US.
  • Futures_Binance
    Supports Binance's Chinese trading pairs:

    javascript
    function main() { let ticker = exchange.GetTicker("币安人生_USDT.swap") Log("ticker:", ticker) // {"Info":{...},"Symbol":"币安人生_USDT.swap","Open":0.29622,"High":0.31661, ...} }

    For the exchange.IO() switching functions of Binance Futures (dual-side position mode, isolated/cross margin, unified account, STP mode, etc.), please refer to the exchange.IO function documentation.

  • Futures_HuobiDM

    • Switch address:
      Use exchange.IO("base", "https://xxx.xxx.xxx") or exchange.SetBase("https://xxx.xxx.xxx") to switch the base address of the exchange interface.

    Supports Huobi's Chinese trading pairs:

    javascript
    function main() { let ticker = exchange.GetTicker("币安人生_USDT.swap") Log("ticker:", ticker) // {"Info":{...},"Symbol":"币安人生_USDT.swap","Open":0.29622,"High":0.31661, ...} }

    For the exchange.IO() switching functions of Huobi Futures (signHost, isolated/cross margin, one-way/two-way position mode, unified account, etc.), please refer to the exchange.IO function documentation.

  • Huobi

    • Switch special trading pairs:
      Supports Huobi spot leveraged tokens, for example LINK*(-3); the code defined by the exchange is link3susdt, and when setting this trading pair on the FMZ Quant trading platform it is written as LINK3S_USDT.
      You can also switch the trading pair within the strategy:

      javascript
      function main() { exchange.SetCurrency("LINK3S_USDT") Log(exchange.GetTicker()) }
      python
      def main(): exchange.SetCurrency("LINK3S_USDT") Log(exchange.GetTicker())
      rust
      fn main() { exchange.SetCurrency("LINK3S_USDT"); Log!(exchange.GetTicker(None)); }
      c++
      void main() { exchange.SetCurrency("LINK3S_USDT"); Log(exchange.GetTicker()); }

    Supports Huobi's Chinese trading pairs:

    javascript
    function main() { let ticker = exchange.GetTicker("币安人生_USDT") Log("ticker:", ticker) // {"Info":{...},"Symbol":"币安人生_USDT","Open":0.29622,"High":0.31661, ...} }
  • Futures_Bibox

    • Unsupported interfaces:
      This exchange does not provide interfaces for querying current pending orders or querying market historical trade records, so the GetOrders and GetTrades functions are not supported.
  • BitMEX

    • Market order buy
      In the BitMEX spot trading order placement interface, the order quantity for a market buy order is not the amount, but the number of coins to trade.
  • Bitfinex

    • Market order buy
      In the Bitfinex spot trading order placement interface, the order quantity for a market buy order is not the amount, but the number of coins to trade.
  • AscendEx

    • Market order buy
      In the AscendEx spot trading order placement interface, the order quantity for a market buy order is not the amount, but the number of coins to trade.
  • Futures_Phemex

    • K-line interface
      The data returned by this exchange's K-line interface does not include the current Bar data.
    • Switch isolated/cross margin:
      This exchange does not provide an interface for switching cross/isolated margin; it needs to be set on the exchange side.
  • Futures_Aevo

    • Order Id description:
      This exchange's order Id consists of the actual Id and the order timestamp, separated by an English comma, in order to support the exchange.GetOrder(Id) function for querying orders. Since the order timestamp in the data returned by the exchange changes with the order status, if you need to record information such as the order Id locally, please separate out the actual order Id before recording it.
  • Futures_dYdX
    Currently supports the dYdX v4 version. Please refer to the dYdX v4 User Guide.

  • Futures_Hyperliquid
    Please refer to the Hyperliquid User Guide.

    For the exchange.IO() switching functions of Hyperliquid Futures (isolated/cross margin, mainnet/testnet, vaultAddress, walletAddress, expiresAfter, etc.), please refer to the exchange.IO function documentation.

  • Futures_Lighter

    • Switch test environment:
      The test environment can be selected and set when configuring the exchange object, or you can use the exchange.SetBase() function to modify the REST API endpoint to switch to the test environment.

    For the exchange.IO() switching functions of Futures_Lighter (isolated/cross margin, order expiration time, etc.), please refer to the exchange.IO function documentation.