The FMZ Quantitative Platform is a must-see

Author: The grass, Created: 2019-08-09 14:54:48, Updated: 2023-07-16 23:11:11

[TOC] After learning this tutorial, you will understand the architecture and functionality of the FMZ Inventor Quantitative Trading Platform, which allows you to create strategies and run them in real time.https://www.fmz.com/bbs-topic/4158I'm not sure what to do.https://www.fmz.com/bbs-topic/4183

Other information


FMZ Inventors Quantitative Platform (originally BotVS) is a specialized quantitative community, created in 2014. Here you can learn, write, share, buy and sell quantitative strategies, online review and use analogue discs. It supports commodity futures and OTC futures, and also supports almost all common digital currency exchanges. FMZ is suitable for beginners in quantitative trading, even without a foundation.

对于数字货币现货交易所,目前几乎支持所有,如果有其它需要的交易所,提出后也会很快支持;数字货币期货交易支持有:OKEX、Huobi、GateIO、BitMEX、Deribit、BFX;支持的杠杆交易所有:OKEX、Huobi、Binance、FCoin、ZB、Bibox;支持的永续合约交易所有:BitMEX、Deribit、GateIO、OKEX、BFX、Bibox;支持Derbit数字货币期权交易;模拟交易所:交易所的测试网如BitMEX以及FMZ官方现货模拟交易平台wex.app。

The FMZ Quantification Platform supports the full range of high-level languages such as Javascript, Python, and C++, and also supports visualization, macOS (compatible with Microsoft Windows) and Pine (compatible with Trade ingView).

The platform charges by the hour, per virtual robot, $0.05 per hour, less than one hour per hour, suspended and restarted without recharging, and the cost of the platform is $0.05 per hour.A single FMZ can operate multiple exchanges, multiple accounts, multiple trading pairs.

Servers that run on a physical platform need to be prepared by themselves or rented from the FMZ platform. The current mainstream overseas server is about 30 yuan/month. Only commodity futures can be traded.

Note: FMZ's digital currency section has been separated, and the domestic website www.fmz.cn focuses on commodity futures trading, which can be redeemed in RMB, while foreign websites can only redeem in USD or USDT.

User-focused


  • 1.程序化交易新手,但有交易经验和策略思想,能够学习简单的编程并用于实盘。FMZ量化对接口的统一封装和范例将大大节约你的学习时间。
  • 2.职业或半职业的策略研究员,能够熟练的编写策略,根据用户要求定制相关策略收费。
  • 3.有成熟策略需要出售或需找资金,可在FMZ上展示实盘,并出租策略。
  • 4.有其他商品期货程序化平台使用经验,如文华财经,开拓者等,能够编写麦语言策略,FMZ平台很适合这些用户入门,提供更强大的功能。
  • 5.有稳定的运行的策略和编程经验,需要FMZ提供的网页化管理和图表功能,更好的运行自己的实盘。
  • 6.有编程和交易经验,需要看其它公开策略、在社区交流来寻找自己的策略思路。
  • 7.完全无编程经验,也不愿意学习,想购买成熟策略。(不太推荐,至少需要掌握相关知识)

Platform architecture


FMZ's architecture is special, unlike other trading software, which requires downloading the client, and basically only needs to be managed on the FMZ website, so it has many advantages. The main function of the FMZ website is to write the policy, manage the real disk. While the real disk is specifically executed by the user himself on the server or computer's host, the host is responsible for communicating with the FMZ website to pass logs, directly run the robot to access the exchange and obtain transactions.https://www.fmz.com/digest-topic/7542

API-KEY and policy source code security


The API-KEY is the user's important privacy information, FMZ does not store the user's KEY, the server saves the browser encrypted data based on the user's password, the disk is created and sent to the administrator, the administrator decrypted after use, because FMZ does not save the user's password explicit, so the user's API-KEY even FMZ is not available. Users need to protect the API-KEY explicit, FMZ website password and the server where the administrator is.

The source code of the policy is stored on the FMZ server. If you want to execute the policy locally, you can save your code to a Python file and run it directly in the policy reference. See the FAQ at the end of the tutorial.

If you want to rent a policy and not see the source code as the user does, you need to complete the policy in js, which is compiled into machine code executed by the other host, which is very difficult to counter-compile. While the Python language itself does not have an encryption mechanism, FMZ recently upgraded the encryption mechanism for selling the Python policy source code, but it also does not completely solve the risk of policy leakage.

New entry steps


  1. Learn a programming language, I recommend JavaScript and Python, and simply use it. If you just want to quickly implement some relatively trendy strategies, you can also try the Mac language and the Pine language.
  2. Familiarity with the FMZ platform, deployment of their own hosts, and the relationship between strategy, real-time, hosts, and websites.
  3. Browse the API documentation to learn about the interface and functions.
  4. Learn the teaching strategies of Strategy Square and write down strategies for simple functions such as price pushing, iceberg commissioning, etc.
  5. Develop your own strategies, become familiar with specific API interfaces and common errors, and learn how to ask the right questions and search for relevant posts.
  6. Simulated disk and real disk run strategies, finding more problems in real battle.

The important thing is to have the courage to start learning, step by step, all the steps must be handled personally. Even if the beginning seems very difficult, but when you finish the first strategy, you will find out that everything is so simple. If you have a certain programming basics, you can start writing strategies in a week, if you do not know programming knowledge, you need an additional week to learn the most basic programming knowledge.

If you have any questions, you can always go to the forum and post questions.https://www.fmz.com/bbsOr a job application.https://www.fmz.com/m/ticketsIf you have a question, you should try to answer it in the documentation or forum before you try to answer it.

Recommended learning resources


30 minutes running a hard drive

The following are the steps to run a hard drive from scratch:

  1. Adding the Exchange API-KEY to the FMZ website.
  2. I've been working on this project for a while.
  3. Deploy the host running the virtual disk.
  4. This is the first time I've seen this video.

If the first three steps have already been done, only step four is needed, followed by an example of a WeChat Price Alert Tray, introducing how to run a Tray from the beginning, more details about the platform's features will be presented in the next chapter.

1.添加交易所


The first step is to log in to the respective exchange website to apply for the API-KEY, which is divided into two parts.Access KeyandSecret KeyThe Access Key may have other names, but just remember one isSecret KeyAnd the other one isAccess KeyThe API-KEY is used to encrypt data and authenticate identity, similar to a username password, and is very important not to leak. Different exchange application locations are different, and can be found as long as you look for the API key.Note that if an exchange supports both spot and futures, they need to be added separately, such as OKEX and OKEX futures, Huobi and Huobi futures, even if their API-KEY is the same. 这里以FMZ官方模拟交易所Wex.app为例。

The web address is https://wex.app(Please note that due to networking reasons, wex simulation transactions can be accessed by overseas custodians at all times)You need a mailbox account, and after registering on the Wex simulation exchange, you will transfer the virtual assets in the wallet to the Coinbase account, which initially has no trading assets. Click API management at the top right corner of the website. Click Create API at the user's header.img

The API-KEY, Access Key:9af1b5bfe833b2ee0d54bb95325579d5,Secret Key:2043b8629620d4d69590803c55fa92bc, which is shown in this demo, can only be seen once, so remember to record and save.img

Go to the Add Exchange interfacehttps://www.fmz.com/m/platformsClick on the Add Exchange button and click on the Add Exchange button.img

Select the category of the exchange, select the name of the exchange, select WexApp (since there are many exchanges, you can enter the text directly by swiping), and then copy the KEY you just applied for, note that an exchange can be added multiple times, using different label separation. Adding the exchange requires entering the FMZ website password, where the browser encrypts the input KEY and uploads it.img

Once the addition is complete, you can see the exchanges that have been added on this page, and you can also edit the exchanges that have been added.img

If you want to simulate CTP trading in commodity futures, you need to add simnow, for specific steps:https://www.fmz.com/bbs-topic/325

2.创建与修改策略


On the policy page:https://www.fmz.com/m/strategiesTo demonstrate that we are directly copying a strategy, you can find the public policy for setting the price of Bitcoin and WeChat pushing (Teaching) in the Teaching Policy section of Teaching Square.https://www.fmz.com/strategy/125482In this article, you will find a list of the most common types of cookies.

The following is a copy of the policy, in which the policy name contains a link to the policy section in English, you can also use this method if you want to publish a policy with an English name. The parameter is a global variable, which can be directly referenced in the policy code. The policy code is simple, constantly using GetTicker in the dead loop to obtain the latest price, when the standard push is reached, a message is pushed to WeChat.img

If a policy is changed, it will only take effect if the policy is saved and restarted on the hard disk running the policy.

3.部署托管者


The host page:https://www.fmz.com/m/nodesAs mentioned earlier, the user's virtual machine is not operated by the FMZ platform, but by the user himself, so a program to execute the policy is needed, namely the host. The host can run on Linux\Mac\Windows. Note that since almost all digital currency transactions are not available in the country of origin, the host needs to run on an overseas server, the user can choose the server provider to buy a Linux server (the system is generally optional centos), the server can choose Amazon, Google, digital Ocean, etc. If there is no dual-currency credit card, you can also choose a service provider that supports PayPal.

The purchase of a server may seem difficult, but it is a necessary step to quantify the digital currency.Here is a detailed demonstration of the purchaseIf the overseas company is in trouble, you can also choose the Ali Cloud Hong Kong server. If you are in trouble, you can rent a new server directly from the FMZ platform at a time, FMZ will rent a new server directly from the server manufacturers such as Ali Cloud and automatically deploy the host of the user, the simplest but relatively expensive.https://www.fmz.com/bbs-topic/2848

For users of commodity futures, you can directly rent the Ali Cloud server in Shanghai or Hangzhou by month, at a price of 40 yuan / month. The price has been reduced to the minimum (your own rental is basically also this price), you can save the hassle of renting your own server and managing, the trustee can also upgrade with one button, which is highly recommended.

img

This demonstration is an analog exchange that can be deployed directly to your own computer (commodity futures can also be used on your own computer).• Select the 64-bit interface version, and after uninstalling the right-click to run the robot program with administrator privileges.• Put the address on the website (each user is different, look at the administrator page after landing) and fill in the password information of the FMZ website into the program, point run as it appears.2019/08/09 12:03:30 Login OK, SID: 90706, PID: 31376The logs are stored in the logs folder in the host directory. The logs are stored in the logs folder in the host directory. The newly deployed administrators are displayed in the host management interface.img

Note that a server can also deploy multiple hosts, but this is generally not necessary. Hosts and FMZ websites communicate to return to the state of the disk and control the disk, and occasional hosts are offline prompted due to problems with overseas servers and domestic communications, but do not affect the actual operation of the disk. If a host is completely offline and will not be able to operate the disk run by this host, it is necessary to remove this host. If the new feature is not supported by the old host, an announcement will be issued, users can choose to update according to their needs.

4.创建和管理实盘


After doing this, you can actually run a hard drive.https://www.fmz.com/m/robotsClick the button to create a virtual disk, and the following settings appear:img

When creating a virtual table, it is necessary to set a specified policy, a specified operating trustee, the exchange and trading pair to be operated, the default K-line cycle, policy parameters, etc.A physical disk can add multiple exchange pairs or control multiple pairs of transactions on the same exchange.If the desired transaction pair is not present in the drop-down, you can click on Custom Manual Input. Other parameters can be modified on a specific disk page in addition to the runtime policy.

After creating the disk, you can find it on the disk page, and click on it to get to the current disk.img

So we created a real disk, is it not simple?

Details of the platform

The first is the home page of the Control Center after landing, where the side and top are the navigation buttons, which will be introduced one by one below.img

  • The control centerThe user interface:https://www.fmz.com/m/dashboard
  • The strategy: Policy Square, user-published and sold policies, where you can click on the corresponding tag to filter for a specific policy category.https://www.fmz.com/square
  • The outlineThe user can make observational comments on a virtual disk that is publicly accessible.https://www.fmz.com/live
  • The librarySome of FMZ's official highlights.https://www.fmz.com/digest
  • The communityThe user posts a question on the exchange platform.https://www.fmz.com/bbs
  • PackingThe FMZ official does not guarantee the following: posting requirements and copywriting policies, all contacted by the user himself.https://www.fmz.com/markets
  • The API documentation:FMZ writing policy requires API introduction, API questions can be searched here.https://www.fmz.com/api
  • The Strategy LibraryAll tactical locations:
  • The ExchangeAll exchanges added:
  • The TrusteeAdded: all hosts
  • The real thing: All disks that have been running, including discontinued ones
  • Debugging toolsEasy to debug: partial code without creating a hard drive
  • Trading terminalsThe user interface is simple:
  • Research environmentSupport for strategic research with the Jupiter Notebook.
  • BillsConsumption and charging records
  • The newsThere are various types of notification:
  • The work orderThere is a problem: In addition to sending a forum, you can also send a job application directly.
  • Searching for data: K-line and disk-level data stored on the platform for easy browsing and saving
  • Analytical toolsThe following is a simple calculation analysis of the market:

Directory management


img

  • 1.实盘的名字,点击可进入此实盘管理页面。
  • 2.实盘机器人的分组名称,方便管理大量实盘。
  • 3.此实盘机器人运行的策略名称。
  • 4.实盘状态,由正在运行、停止、完成、出现错误四种状态。
  • 5.实盘盈利,具体不一定代表了盈利数据,使用户自己输出,可以代表任何数据.
  • 6.公开自己的实盘,可以在围观中让其它用户看到。
  • 7.监控实盘,实盘停止后自动推送消息。
  • 8.停止或重启实盘机器人。
  • 9.当前账户余额和实盘可运行的时间。
  • 10.对策略的分组进行管理

Strategic management


img

  • 1.策略名称。
  • 3.策略操作选项,如公开、租用、出售等。
  • 4.策略名称。
  • 5.添加和管理新的分组,可以把不同类型的策略分组,方便管理。

How to write an interface


The policy can be written on the FMZ website or remotely. The policy parameters will be explained in the next tutorial.img

  • 1.点此进入回测,关于回测的具体说明将放在策略编写初级教程里。
  • 2.策略使用的语言选择,策略创建后不可切换语言。
  • 3.策略名称。
  • 4.笔记是编写策略的记录,仅自己可见;描述是策略说明,策略公开后其他人可以在策略页面将看到;手册是策略的使用说明,购买或复制策略的可以看到。
  • 5.策略类型,分为通用策略和模板,关于模板可参考API文档: https://www.fmz.com/api#模板类库
  • 6.策略分组。
  • Save, can be edited using the Ctrl+S shortcut key.
  • 7.保存回测设置:会把回测参数保存在代码前面,重新打开策略将保留回测设置.
  • 7.下载源码:将代码下载到本地。
  • 7.导入导出策略:顾名思义,并且策略的参数和各种设置一并保留。
  • 7.皮肤:不同的代码背景和着色风格。
  • 7.代码美化:自动整理代码。
  • Open VIM mode, Vim is a commonly used interfaceless editor with powerful features.
  • 8.远程编辑,包含常用的代码编辑器插件,可在本地编写策略,自动同步到FMZ。具体说明:https://www.fmz.com/api#远程编辑
  • 9.选择要引用的模板,要先在策略广场把模板复制下来。
  • 10.策略参数,参数将在下篇教程详细介绍。

Share or sell your strategy


img

In the drop-down options of the operation, you can see the option to open the filter, which has both internal sharing and public sharing modes.img

Finally, a duplicate link is generated, which can be opened by others, and the source code and parameters of the policy can be obtained by entering the duplicate code.

复制地址: https://www.fmz.com/m/t/161415
复制码: e3d2e2edd3060bd6f477c1106cf182f5

If you choose to share publicly, your strategy will appear in the policy square for everyone to see.

There are three ways to choose to sell the plugin: internal sale, software registration, public sale, and the public policy is that others will not be able to access the source code by copying the address, but only run the real disk.

Internal selling is the most common way, if you have a policy that needs to be shared separately with others (not necessarily for a fee), you can choose this way, filling in the validity and concurrent number. Publicly sold policies appear in the policy square's fee policy, which needs to be reviewed and made public for a period of time.

Trading terminals


The trading terminal is a web-based trading page where you can manually control all the exchanges you add.img

  • 1.执行指令的托管者,账户信息、下单之类的都要发到该托管者上执行。
  • 2.选择交易所和交易对。
  • 3.部分行情是由FMZ网站推送的,此时提示高速通道。对于没推送的数据,可以选择手动刷新或定时刷新。
  • 4.行情K线。
  • 5.账户信息,定时或手动刷新。
  • 6.手动下单页面。

Account management and recharging


Navigate to the left to the charging page, which provides the following information:img

Click the account header in the upper right corner of the website to access the account settings, and manage your FMZ account on this page, for a brief introduction here.

  • The News Center: summary of various news, including forum posts, job list information and more.
  • Google verified byIt's better to turn on Google Authentication to improve security.
  • Frontier warningsNote: You will receive an email and WeChat notification when your account balance is less than this value, set to 0 to prohibit the use of this feature, and only one notification in 24 hours if you do not charge or change this setting.
  • Push settingsHere you can link to WeChat, Telegram, Mailbox, etc. to receive push messages on the hard drive.
  • The API interface:FMZ also has its own API, which provides extensibility for virtually all real-time operations.
  • Sub-account groups: You can create sub-accounts with only partial permissions, which can be used to modify the policy of the shared account.
  • Promoting the return of commissionsThe following links are provided to promote the FMZ platform:https://www.fmz.com/sign-up/1247886◦ Specifically:https://www.fmz.com/bbs-topic/3828

More

BudgetIt's too messy, there's no tutorial from simple to easy, the newbie is all frowned upon, all introductory to the function method, even the first step is dumb.

king_wzThe historical data of the platform seems to be different from the historical data of the Binance platform.

king_wzCan't draw offline with python oh js can {TA.MA ((records, 14) is there a bug or not support

changyuyunI'm a coder, and I'm particularly interested in figuring out how this platform works. It feels like writing strategies directly is a bit of a hassle. Can you describe how it works?

king_wzYou can either download and use what was written before in ccxt, or you need to convert it to the fmz API.

king_wzIs it possible for Python to use FMZ's API directly in this policy, and to use other open source libraries?

Zhu YongshengNo one taught him how to cook.

clubk818I just got on the platform today and found out that it's too cool and I hope to keep it.

hatepopHow to contact customer service

Apple quantifiedIs it necessary for a real-time replacement trustee to break even?

yxiao8911OK platforms with permanent contracts can receive APIs?

LJG658658Are there groups?

webkill

webkillWhat happened to the money in the OKEX account?

Programmed monkeysIn the wex.app trading terminal window, the wex.app exchange simulation failed to be called, prompting: GetAccount: invalid nonce GetOrders: invalid nonce GetOrders: invalid nonce GetOrders: invalid nonce Is there a need to update the wex API?

jkyeiMy robot stopped charging and restarted, I had to select Auto-Restore, and when the program started, I flattened the original hold. I want the robot to continue running, not flatten the original hold, as long as it is default, restore the hold, please set or modify the policy.

123456 quantifiedMac admin can't download

exclusivezhangI feel that this is what I want. I'm too tired to eat at night. Let go of my hands.

The lonely motherLearning

xiekeThe couch

The grassThis series of tutorials goes from easy to hard, first introducing platform use, then API functions.

The grassexchange.GetTicker))) Read the tutorial at the top of the homepage

king_wzI'm going to buy and sell at a wholesale price, but there's no way to do that, or is there a way to get the current price so I can do my own calculations?

king_wzI'm not sure if you're familiar with the concept of buying and selling at the wholesale level.

The grassYou can use this library to draw your own.

king_wzI'm not talking about the 10-day averages that you see on a pole, the 5-day averages that you see on a pole, that can form a gold fork.

The grass https://www.fmz.com/strategy/39066

king_wzNo, I'm copying the example from the past, js has, python doesn't.

The grassPython also has a linear class library, which is easy to use directly to check if there is no data.

The grassYes, it supports full Python.

The grassDirect job application

The grassThank you for your support.

The grassLet's look at the tutorial first.

The grassLook at the strategy design, if you can identify the original position, you don't normally use it.

The grassYes, you can.

The grassThe profits are self-published

Programmed monkeysWell, I tried to update the time zone on the problem server and synchronize to the latest time, and the problem still doesn't resolve. Then I replaced a new server, and the connection was back to normal.

The grassUpdated server time trial, I tested without problems

jkyeiThe strategy is on the platform, the auto-restore function is on the platform, how should I do it?

The grassIt's a matter of designing specific strategies to avoid this.

jkyeiThis is the strategy of js, and it's been done many times already.

The grassWhat is the Mayan strategy?

The grassWhat's wrong?

The grassThe tutorial at the top of the homepage can be read and solved 95% of the time.

The grass ^_^