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

Use md5 encryption for verification. Below are calling examples in Python and Golang:

python
#!/usr/bin/python # -*- coding: utf-8 -*- import time import json import ssl ssl._create_default_https_context = ssl._create_unverified_context try: import md5 import urllib2 from urllib import urlencode except: import hashlib as md5 import urllib.request as urllib2 from urllib.parse import urlencode accessKey = '' # your API KEY secretKey = '' def api(method, *args): d = { 'version': '1.0', 'access_key': accessKey, 'method': method, 'args': json.dumps(list(args)), 'nonce': int(time.time() * 1000), } d['sign'] = md5.md5(('%s|%s|%s|%d|%s' % (d['version'], d['method'], d['args'], d['nonce'], secretKey)).encode('utf-8')).hexdigest() # Note: urllib2.urlopen function may have timeout issues, you can set timeout, for example: urllib2.urlopen('https://www.fmz.com/api/v1', urlencode(d).encode('utf-8'), timeout=10) sets timeout to 10 seconds return json.loads(urllib2.urlopen('https://www.fmz.com/api/v1', urlencode(d).encode('utf-8')).read().decode('utf-8')) # Return docker list print(api('GetNodeList')) # Return exchange list print(api('GetPlatformList')) # GetRobotList(offset, length, robotStatus, label), pass -1 to get all print(api('GetRobotList', 0, 5, -1, 'member2')) # CommandRobot(robotId, cmd) send command to live trading bot print(api('CommandRobot', 123, 'ok')) # StopRobot(robotId) return live trading bot status code print(api('StopRobot', 123)) # RestartRobot(robotId) return live trading bot status code print(api('RestartRobot', 123)) # GetRobotDetail(robotId) return live trading bot detailed information print(api('GetRobotDetail', 123))
mylang
package main import ( "fmt" "time" "encoding/json" "crypto/md5" "encoding/hex" "net/http" "io/ioutil" "strconv" "net/url" ) // Fill in your FMZ platform API key var apiKey string = "" // Fill in your FMZ platform secret key var secretKey string = "" var baseApi string = "https://www.fmz.com/api/v1" func api(method string, args ... interface{}) (ret interface{}) { // Process parameters jsonStr, err := json.Marshal(args) if err != nil { panic(err) } params := map[string]string{ "version" : "1.0", "access_key" : apiKey, "method" : method, "args" : string(jsonStr), "nonce" : strconv.FormatInt(time.Now().UnixNano() / 1e6, 10), } data := fmt.Sprintf("%s|%s|%s|%v|%s", params["version"], params["method"], params["args"], params["nonce"], secretKey) h := md5.New() h.Write([]byte(data)) sign := h.Sum(nil) params["sign"] = hex.EncodeToString(sign) // 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() { settings := map[string]interface{}{ "name": "hedge test", "strategy": 104150, // K-line period parameter, 60 means 60 seconds "period": 60, "node" : 73938, "appid": "member2", "exchanges": []interface{}{ map[string]interface{}{ "eid": "Exchange", "label" : "test_bjex", "pair": "BTC_USDT", "meta" : map[string]interface{}{ // Fill in access key "AccessKey": "", // Fill in secret key "SecretKey": "", "Front" : "http://127.0.0.1:6666/exchange", }, }, }, } method := "RestartRobot" fmt.Println("Call interface:", method) ret := api(method, 124577, settings) fmt.Println("main ret:", ret) }