Create your own proprietary multi-user quantitative trading platform at zero cost and fast

Author: The Little Dream, Created: 2018-04-14 14:30:55, Updated: 2019-07-31 17:42:26

Create your own proprietary multi-user quantitative trading platform at zero cost and fast

Anyone can build a quantitative trading platform using the Inventor Quantitative Extension API, and this example project shows how to build a powerful quantitative trading platform using Python and the Inventor Quantitative Extension API.

  • Embed into existing systems

    According to this DEMO project, it is possible to write server-side code, add front-end pages to embed existing systems such as forums, blogs, communities, etc.; In order to achieve flexible access to existing user groups, and where existing user groups do not fully experience the underlying technical support quantified by the inventors, user use is more concise and easy to operate.

  • Supporting the market

    • CTP Commodity Futures (expired, department store, department store, and exchange)
    • EOS (main foreign futures exchanges such as CME, CBOT)
    • More than 30 blockchain asset trading platforms worldwide
  • Build your own quantification platform

    • Strategic design for high freedom

      Writing quantitative trading strategies using Python, JavaScript, C++ and freely customizing them to implement your trading ideas in a world of quantitative trading.

    • Powerful and efficient feedback systems

      From now on, it will no longer be necessary to collect data, and the local retrieval system engine can be easily configured with just one command, link:https://github.com/fmzquant/backtest_python

    • Simple architecture

      An HTTP server side program can be easily built with just a few front-end pages written.

  • The DEMO project

    • Name: Inventors Quantify demonstrates how to build your own Asset Management Quantification platform using the Inventors Quantified Extension API

    • This DEMO project is installed

      • The first thing to do is to clone this demo project.

        git clone https://github.com/fmzquant/fmz_extend_api_demo.git
        

        alt

      • Switch to this directory, run pip, install

        img

        pip install -r requirements.txt 
        

        img

        Note: If Permission denied is prompted, sudo pip install -r requirements.txt is required to execute pip, and enter the operating system password as requested.

      • Once installed, configure the server program to be used, inventor quantification, account API KEY

        Inventor Quantification Expanded API KEY for use See the Inventor Quantification API documentation for more detailshttps://www.fmz.com/api

        Created by Inventor Quantified API KEY

        img

        Write the API KEY, and the demo will be executed.app.pyThe server-side program.

        img

    • This DEMO project runs commands on the server side

      python app.py
      
      • Running shows:

        img

        After running the server side program, open the local page in the browser:http://127.0.0.1:5000

        img

      • Test the registration page

        img

        The project DEMO Quantitative Platform is up and running, register with the account of this testing platform (which stores local data), log in and configure the API KEY of the exchange as a user of this platform.

        img

        img

        It is now configured as follows:

        img

        The three strategies shown on the page are just UI displays, which also require the administrator of the Asset Management Quantitative Platform to specifically design the implementation, here for demonstration purposes only.

      • Configure a test policy In this DEMO project, the server detects that pressing the Start button triggers a search for a policy that contains the keyword "main" in the inventor's quantified account, and uses this policy to bind the bot to run. So we created a strategy called the main test profit.

        The main Test profit strategy code is as follows:

        function main() {
            while(true) {
            LogProfit(Math.random()*100);
                Sleep(1000);
            }
        }
        

        img

        After editing the code, click Save.

        Please note: It is necessary to ensure that there is an online host before running.https://www.fmz.com/bbs-topic/463

      • Clicking on the Start button automatically creates a bot that binds a demonstration policy that will only randomly output a value as a yield value.

        A newly created robot can be seen in the inventor's quantized control center:img

        The DEMO web page also shows the corresponding random number.img

      • A robot running on inventor quantized by appId identifies the current user logged on to the DEMO platform

        img

        def robot_run(robotId, appId, exchanges):
            strategyId = -1
            # 从策略库里选出一个包含main字符串的策略运行, 也可以预定义
            for ele in api("GetStrategyList")['data']['result']['strategies']:
                if 'main' in ele['name']:
                    strategyId = ele['id']
            if strategyId < 0:
                raise u"not found strategy"
            settings = {
                    "name":"robot for %s" % (appId, ),
                    "args": [], # our custom arguments for this strategey
                    "appid": appId, # 为该机器人设置标签,关联到本用户
                    "period": 60,
                    "strategy": strategyId,
                    "exchanges": [],
                    }
            for e in exchanges:
                settings["exchanges"].append({"eid": e.eid, "pair": get_default_stock(e.eid), "meta" :{"AccessKey": e.accessKey, "SecretKey": e.secretKey}})
            if robotId > 0:
                return api('RestartRobot', robotId, settings)
            else:
                return api('NewRobot', settings)
        

        As you can see, the settings in the code are the creation of the bot's configuration information and the appid is used to tag the user.

  • Updated by

    # Github 地址更新:  https://github.com/fmzquant/fmz_extend_api_demo
    

More

Nature to quantify investmentThe configuration environment has been incorrect. Do you need that version of python?

churchillxyIs it possible for the user to configure the user's exchange API and run the user's own virtual disk based on the administrator's policy?

LizzaZero is ambitious, the key is to be able to be ambitious.

JThis platform that I built can only see and control the operation of robots, can't write strategies and add robots, right?

The Little DreamThis is a DEMO, open source, and you can see the source code directly.

churchillxyGood, thank you.

The Little DreamWhat's up? Also, how to add these features to the forum? What's up? These can be specifically developed. The demo simply means that you can build a website yourself, and then use FMZ's extensible API to use FMZ's real disk service. So you just build a website, you can make a platform.

churchillxyIs the cost of running the user is also is it $0.05/hour?

The Little DreamYou can design a policy for the user to see, allowing the user to configure their own parameters. These are all based on your product design (the underlying service is FMZ). Like the DEMO in the article, you can freely design your own quantification platform according to the product's needs.

The Little DreamCurrently not open Policy Writing Interface (possibly later), other features are available (e.g. create robots etc..) and Debugging tools Interface is also supported.