The resource loading... loading...

Docker

The FMZ Quant Trading Platform’s docker software is the core part of the entire quantitative trading system, Docker Docker can be understood as the executor of your trading strategy, responsible for complex data requests, data reception, network links, log postback and so on. The live trading strategy program runs on the docker’s software, not on the FMZ Quant Trading Platform website. The docker runs on your server, even if the FMZ Quant Trading Platform website has a network failure, it will not affect the operation of your docker. The docker can run on Linux, Windows, Mac OS, Android, Raspberry Pi ARM Linux and other systems. The live trading logs managed by the docker are stored in the directory ./logs/storage. The file is a Sqlite database file with db3, which can be edited directly by the Sqlite management software. For a file with extension db3 in the live trading database, the file name is the bot ID.

Deployment of Docker

You can view the dockers associated with the current FMZ Quant Trading Platform account deployment on the Docker page, and you can switch the list display or detailed information display, and you can query the IP address, version, compile and release time, and other related information of the docker on this page. Click Add docker button to jump to Docker Deployment Page, docker deployment is divided into two modes: 1) One-click Rent a docker VPS. 2) Add a docker manually.

Docker deployment page

One-click Rent a docker VPS

Click the One-click Rent a docker VPS tab on the Docker page and select the server to be deployed based on the configuration, server room region, and other requirements. Click “Buy it now” and enter the account password of the current FMZ Quant Trading Platform for verification, and the docker program deployment will be carried out automatically after the verification is passed. The whole deployment process takes a few minutes and the system will automatically install commonly used Python libraries. The server rented after clicking “Buy Now” has only limited system privileges and does not support remote login as it is rented through the platform on behalf of the customer. If there is a need to use some third-party Python libraries that are not pre-installed, it is recommended to deploy them manually using a private server. Server billing for servers rented through the One-click Rent a docker VPS feature is billed separately and has nothing to do with the bot billing. Clicking the “Redeploy” button will not delete the real-time logs and data files in the logs directory under the existing docker directory.

Add a docker manually

You can deploy the docker to a variety of devices, e.g., PCs, servers, Raspberry Pi, and so on. A wide range of mainstream operating systems are supported.

  • Command line version of Linux: Linux AMD64 / Linux 386 / Linux ARM64 / Linux ARMv7
  • Command line version of Mac: Mac Intel64 / Apple Silicon
  • Command line version, interface version of Windows: 64-bit / 32-bit
  • Docker image

After logging in to the device that needs to deploy the docker program, download the corresponding docker program according to the operating system of the device. The download link can be found in the content displayed after clicking the Add a docker manually tab on the Docker page. Deploying the docker program requires 2 parameters to be set:

Add a docker manually

  1. The correspondence address containing the UID of the FMZ Quant trading platform.
  2. The password for the FMZ Quant Trading Platform account corresponding to the UID.

Configure the “Communication Address” and “FMZ Quant Trading Platform Account Password” when deploying the docker:

  • Docker for Windows The Windows Interface version of the docker can fill in these two parameters directly to the corresponding input box controls on the docker’s interface.

  • Command line version of the docker For other command line versions of the docker program, there are different commands for different operating systems. Using Linux & Mac as an example, use the command: . /robot -s node.fmz.com/123456 -p 654321, the following describes each part of the command:

    . /robot means to run robot, an executable program (i.e., a docker program), where 123456 is the UID, and 654321 is the password of the FMZ Quant Trading Platform account corresponding to the UID. The parameter -s indicates the correspondence address of the UID of the FMZ Quant Trading Platform, and the value of the parameter can be populated with e.g.: node.fmz.com/123456. The parameter -p indicates the “password for the UID’s account on the FMZ Quant Trading Platform”, which can be filled with a value such as: 654321.

    Please note that the parameters here are examples, the actual parameters can be viewed after logging into FMZ.COM and clicking on the Add a docker manually tab on the Docker page. The parameter -p does not have to be explicitly written in the command to deploy the docker, you can use the . /robot -s node.fmz.com/123456 command to run it, and then you will be prompted for a password, which you can then enter manually. In addition, pay attention to issues such as permissions to execute the program, and give the docker program enough permissions to lift the running restrictions.

Specify the IP Address Globally

  • The docker of the Windows system interface version can set the IP address directly on the docker software interface, and the docker software defaults to setting the IP automatically.
  • Dockers running in the command line environment use the -I parameter to specify the IP address.
    -I string
        custom local ip address
    -c string
        config file
    -d string
        custom dns resolve server
    -e string
        docker node executable path
    -f string
        docker settings json
    -i string
        docker image name
    -n string
        node name
    -p string
        password
    -s string
        server address
    -u string
        run as system user
    -v  version info
    -vv
        show verbose log
    -w string
        working directory
    

Parameters of the Command Line Version of the Docker Program

After downloading the docker software, the executable file robot after decompression is the docker program; the parameters can be specified for the docker program, when deploying the docker.

  • -v: check the information including the version and compilation time of the current docker program. The complete execution command is based on Apple Mac System: ./robot -v.
  • -vv: Detailed logs of the docker program’s operation and interaction messages are not displayed by default and are not written to the docker log file. In this way, it prevents frequent interaction commands from bloating the logs and taking up space on the hard disk. If you need to keep a detailed log of the docker and display it while the docker is running, you can set the detailed log and interaction messages to be written to the docker log file by using the -vv parameter.
  • -s: the address specified to communicate with FMZ Quant Trading Platform when running the docker program. The complete execution command is based on Apple Mac System: ./robot -s node.fmz.com/xxxxxxx; xxxxxxx is the unique identification ID of each account on FMZ Quant Trading platform; after executing the command, there will be a prompt to input the password for the corresponding FMZ Quant Trading Platform account.
  • -p: you can directly specify the parameter in the run command to input the password, which is not recommended, because the password parameter will be left in the current system record. Suppose the account password corresponding to the address node.fmz.com/xxxxxxx is: abc123456. The complete execution command is based on Apple Mac System: ./robot -s node.fmz.com/xxxxxxx -p abc123456.
  • -n: attach label information to the running docker program. The complete execution command is based on Apple Mac System: ./robot -n macTest -s node.fmz.com/xxxxxxx. There will be a macTest text label in the docker information on the platform docker management page.
  • -l: print the exchange list supported by the current docker. The complete execution command is based on Apple Mac System: ./robot -l, that is, the names of the supported exchanges can be output.

Migration of Bot Data

When you need to migrate the bot data to a docker on another device (server), you can move the database file (database file with extension db3) of the bot to the corresponding path location in the docker’s directory on the migration target device (server). Set the filename to the corresponding bot Id on the platform, so that all log information from the previous bot will not be lost due to migration to the new device.

Docker monitoring

Docker monitoring page, you can enable the docker monitoring function in the docker list operation item or the docker details operation item. After turning on the monitoring, if the docker is offline abnormally, the email address bound to the current FMZ Quant Trading Platform will receive a notification message.

Strategy Library Platform