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

  • Futu Securities
    Supports Futu NiuNiu live trading and paper trading. You need to download the FutuOpenD software.
    When using FutuOpenD to access paper trading, some stock codes are not supported and therefore cannot be traded, but the Futu NiuNiu mobile APP can perform paper trading.
    For configuring exchange objects on the FMZ Quant platform and running FutuOpenD software, please refer to the Futu Securities Configuration Guide.

    • API Call Frequency
      For GetOrder, GetOrders, GetPositions, and GetAccount functions, cached data is used 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.

      Calling exchange.IO("refresh", true) function can disable caching. If caching is disabled, the call frequency is limited to a maximum of 10 queries per 30 seconds, and exceeding the frequency limit will result in an error.

    • Stock Codes
      Example: 600519.SH

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

      Use the exchange.SetContractType() function in 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())
      c++
      void main() { auto info = exchange.SetContractType("600519.SH"); Log(info); Log(exchange.GetAccount()); Log(exchange.GetTicker()); }

      The usage of the exchange.SetDirection function for setting trading direction, exchange.Buy/exchange.Sell order functions, exchange.CancelOrder cancel order function, exchange.GetOrder query order function, etc., are the same as in the futures market.

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

      Excerpt from Futu API documentation:

      javascript
      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 )

      When getting 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 login IP address
      For accounts logged in from non-mainland IP addresses, there are restrictions when obtaining market data. Please refer to the official FutuOpenD (Futu) documentation for details.

  • Interactive Brokers
    Configuring the Exchange:
    Using Interactive Brokers requires running "IB Gateway" or "TWS (Trader Workstation)" software on the system where the docker is located. Taking "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 check the "Enable ActiveX and Socket Clients" option. Note the "Socket Port" in the configuration (TWS default port is 7496 for live/7497 for paper trading).
    • 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 port, for example: localhost:7496.

    Supported Markets:

    • Currently only supports the US stock market, other futures, forex, and other markets are not supported yet.
    • US stock market stock code format examples:
      Apple Inc.'s stock code on the NASDAQ exchange: AAPL.US.
      Tesla, Inc.'s stock code 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 Binance Futures exchange.IO() switching functions (hedge mode, isolated/cross margin, unified account, STP mode, etc.), please refer to the exchange.IO function documentation.

  • Futures_HuobiDM

    • Switching 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 Huobi Futures exchange.IO() switching functions (signHost, isolated/cross margin, one-way/hedge position mode, unified account, etc.), please refer to the exchange.IO function documentation.

  • Huobi

    • Switching Special Trading Pairs:
      Supports Huobi spot leveraged tokens, for example: LINK*(-3), the exchange-defined code is: link3susdt, when setting this trading pair on the FMZ Quant Trading platform, write it as LINK3S_USDT.
      You can also switch trading pairs in the strategy:

      javascript
      function main() { exchange.SetCurrency("LINK3S_USDT") Log(exchange.GetTicker()) }
      python
      def main(): exchange.SetCurrency("LINK3S_USDT") Log(exchange.GetTicker())
      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:
      The exchange does not support querying current pending orders or querying market historical trade records, so GetOrders and GetTrades functions are not supported.
  • BitMEX

    • Market Order Buy
      In the BitMEX spot trading order interface, the order quantity for market buy orders is not the amount, but the number of trading coins.
  • Bitfinex

    • Market Order Buy
      In the Bitfinex spot trading order interface, the order quantity for market buy orders is not the amount, but the number of trading coins.
  • AscendEx

    • Market Order Buy
      In the AscendEx spot trading order interface, the order quantity for market buy orders is not the amount, but the number of trading coins.
  • Futures_Phemex

    • K-line Interface
      The data returned by this exchange's K-line interface does not include the current Bar data.
    • Switching 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 order timestamp, separated by a comma. This is 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 order Id and other information locally, please separate out the actual order Id for recording.
  • Futures_dYdX
    Currently supports dYdX v4 version, please refer to dYdX v4 User Guide.

  • Futures_Hyperliquid
    Please refer to Hyperliquid User Guide.

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

  • Futures_Lighter

    • Switching Test Environment:
      The test environment can be set by checking the option 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 Futures_Lighter exchange.IO() switching functions (isolated/cross margin, order expiration time, etc.), please refer to the exchange.IO function documentation.