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

Supports authentication without using token (direct secret_key authentication), allowing generation of URLs for direct access. For example, URLs for sending interactive commands directly to live trading bots can be used for Trading View or other WebHook callback scenarios. For the extended API interface CommandRobot() function, nonce verification is not performed, and there are no limits on access frequency or number of accesses for this interface.

For example: If the AccessKey in the created extended API KEY is: xxx, and the SecretKey is: yyy. Accessing the following link will send an interactive command message to the live trading bot with ID 186515, with the message content being the string: "ok12345".

plaintext
https://www.fmz.com/api/v1?access_key=xxx&secret_key=yyy&method=CommandRobot&args=%5B186515%2C%22ok12345%22%5D

When direct authentication is supported, the Body data from the request can be obtained, only supporting the CommandRobot interface. For example, setting in Trading View's WebHook URL:

plaintext
https://www.fmz.com/api/v1?access_key=xxx&secret_key=yyy&method=CommandRobot&args=%5B186515%2C+%22%22%5D

Note that it must be set in this format: %5B186515%2C+%22%22%5D (before encoding: [186515, ""]), where 186515 is the live trading bot ID on the FMZ Quant Trading Platform.

Simulating Trading View sending WebHook URL alerts:

javascript
function main() { var options = { method: "POST", body: `{"test": 123}`, headers: {"Content-Type": "application/json"} } // WebHook URL alerts will automatically send POST requests, including required headers settings return HttpQuery("https://www.fmz.com/api/v1?access_key=xxx&secret_key=xxx&method=CommandRobot&args=%5B186515%2C+%22%22%5D", options) }

Setting in Trading View message box (Body data to be sent in the request):

  • JSON format:

    img

    plaintext
    {"close": {{close}}, "name": "aaa"}

    The live trading bot with ID 186515 will receive the interactive command string: {"close": 39773.75, "name": "aaa"}.

  • Text format:

    img

    plaintext
    BTCUSDTPERP Crossing 39700.00 close: {{close}}

    The live trading bot with ID 186515 will receive the interactive command string: BTCUSDTPERP Crossing 39700.00 close: 39739.4.

Python, Golang language call examples:

python
#!/usr/bin/python # -*- coding: utf-8 -*- import json import ssl ssl._create_default_https_context = ssl._create_unverified_context try: import urllib2 except: import urllib.request as urllib2 accessKey = 'your accessKey' secretKey = 'your secretKey' def api(method, *args): return json.loads(urllib2.urlopen(('https://www.fmz.com/api/v1?access_key=%s&secret_key=%s&method=%s&args=%s' % (accessKey, secretKey, method, json.dumps(list(args)))).replace(' ', '')).read().decode('utf-8')) # If the API KEY doesn't have permission for this interface, calling print(api('RestartRobot', 186515)) will fail, returning data: {'code': 4, 'data': None} # print(api('RestartRobot', 186515)) # Print detailed information of the live trading bot with ID: 186515 print(api('GetRobotDetail', 186515))
mylang
package main import ( "fmt" "encoding/json" "net/http" "io/ioutil" "net/url" ) // Fill in your own FMZ platform api key var apiKey string = "your access_key" // Fill in your own FMZ platform secret key var secretKey string = "your secret_key" var baseApi string = "https://www.fmz.com/api/v1" func api(method string, args ... interface{}) (ret interface{}) { jsonStr, err := json.Marshal(args) if err != nil { panic(err) } params := map[string]string{ "access_key" : apiKey, "secret_key" : secretKey, "method" : method, "args" : string(jsonStr), } // http request client := &http.Client{} // request urlValue := url.Values{} for k, v := range params { urlValue.Add(k, v) } urlStr := urlValue.Encode() request, err := http.NewRequest("GET", baseApi + "?" + urlStr, nil) if err != nil { panic(err) } resp, err := client.Do(request) if err != nil { panic(err) } defer resp.Body.Close() b, err := ioutil.ReadAll(resp.Body) if err != nil { panic(err) } ret = string(b) return } func main() { method := "GetRobotDetail" fmt.Println("Calling interface:", method) ret := api(method, 186515) fmt.Println("main ret:", ret) }

Implementing TradingView Alert Signal Trading Using FMZ Quant Trading Platform Extended API
Implementing TradingView Alert Signal Trading Using FMZ Quant Trading Platform Extended API, Bilibili Video Link