All Projects → microsoft → Qlib Server

microsoft / Qlib Server

Licence: mit
Qlib-Server is the data server system for Qlib. It enable Qlib to run in online mode. Under online mode, the data will be deployed as a shared data service. The data and their cache will be shared by all the clients. The data retrieval performance is expected to be improved due to a higher rate of cache hits. It will consume less disk space, too.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Qlib Server

Akshare
AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
Stars: ✭ 4,334 (+5250.62%)
Mutual labels:  data, finance, stock, quant
Qlib
Qlib is an AI-oriented quantitative investment platform, which aims to realize the potential, empower the research, and create the value of AI technologies in quantitative investment. With Qlib, you can easily try your ideas to create better Quant investment strategies. An increasing number of SOTA Quant research works/papers are released in Qlib.
Stars: ✭ 7,582 (+9260.49%)
Mutual labels:  platform, finance, quant, investment
Beibo
🤖 Predict the stock market with AI 用AI预测股票市场
Stars: ✭ 46 (-43.21%)
Mutual labels:  finance, stock, quant, investment
Financial Machine Learning
A curated list of practical financial machine learning tools and applications.
Stars: ✭ 2,172 (+2581.48%)
Mutual labels:  finance, quant, investment
Redtorch
Java开源量化交易开发框架
Stars: ✭ 528 (+551.85%)
Mutual labels:  finance, quant, investment
Finance
프로그래머가 투자하는 법
Stars: ✭ 121 (+49.38%)
Mutual labels:  finance, stock, investment
Vnpy
基于Python的开源量化交易平台开发框架
Stars: ✭ 17,054 (+20954.32%)
Mutual labels:  finance, quant, investment
pystockfilter
Financial technical and fundamental analysis indicator library for pystockdb.
Stars: ✭ 26 (-67.9%)
Mutual labels:  finance, stock, quant
akshare
AKShare is an elegant and simple financial data interface library for Python, built for human beings! 开源财经数据接口库
Stars: ✭ 5,155 (+6264.2%)
Mutual labels:  finance, stock, quant
GOAi
No description or website provided.
Stars: ✭ 57 (-29.63%)
Mutual labels:  finance, quant, investment
Rqalpha
A extendable, replaceable Python algorithmic backtest && trading framework supporting multiple securities
Stars: ✭ 4,425 (+5362.96%)
Mutual labels:  finance, stock, quant
Quantdom
Python-based framework for backtesting trading strategies & analyzing financial markets [GUI ]
Stars: ✭ 449 (+454.32%)
Mutual labels:  finance, quant, investment
Xalpha
基金投资管理回测引擎
Stars: ✭ 683 (+743.21%)
Mutual labels:  finance, investment
Iexfinance
Python SDK for IEX Cloud
Stars: ✭ 573 (+607.41%)
Mutual labels:  data, finance
Awesome Quant
A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)
Stars: ✭ 8,205 (+10029.63%)
Mutual labels:  finance, quant
Twstock
台灣股市股票價格擷取 (含即時股票資訊) - Taiwan Stock Opendata with realtime
Stars: ✭ 763 (+841.98%)
Mutual labels:  finance, stock
Sgx Full Orderbook Tick Data Trading Strategy
Providing the solutions for high-frequency trading (HFT) strategies using data science approaches (Machine Learning) on Full Orderbook Tick Data.
Stars: ✭ 733 (+804.94%)
Mutual labels:  quant, investment
Awesome Streamlit
The purpose of this project is to share knowledge on how awesome Streamlit is and can be
Stars: ✭ 769 (+849.38%)
Mutual labels:  data, finance
Axistradecult
Assist tool for trading on stock market, automatic download historical stock data, technical research, chart and analysis.
Stars: ✭ 26 (-67.9%)
Mutual labels:  finance, stock
Moneymanagerex
Money Manager Ex is an easy to use, money management application built with wxWidgets
Stars: ✭ 836 (+932.1%)
Mutual labels:  finance, stock

Qlib-Server is the data server system for Qlib. It enable Qlib to run in online mode. Under online mode, the data will be deployed as a shared data service. The data and their cache will be shared by all the clients. The data retrieval performance is expected to be improved due to a higher rate of cache hits. It will consume less disk space, too.

To sum up, Qlib-Server is designed to solve the following problems:

  • Manage the data in a centralized way, which makes data management (including cache management, date updating) much easier.
  • Reduce the amount of cache to be generated.
  • Make the client light-weighted and leverage the powerful computing resources of remote server

Framework of Qlib-Server

The Client/Server framework of Qlib is based on WebSocket considering its capability of bidirectional communication between client and server in async mode.

Qlib-Server is based on Flask, which is a micro-framework for Python and here Flask-SocketIO is used for websocket connection.

Quick start

Deployment

One-click Deployment

One-click deployment of Qlib-Server is supported, you can choose either of the following two methods for one-click deployment:

  • Deployment with docker-compose
  • Deployment in Azure

One-click Deployment with docker-compose

Deploy Qlib-Server with docker-compose according to the following processes:

  • Install docker, please refer to Docker Installation.

  • Install docker-compose, please refer to Docker-compose Installation.

  • Run the following command to deploy Qlib-Server:

      git clone https://github.com/microsoft/qlib-server
      cd qlib-server
      sudo docker-compose -f docker_support/docker-compose.yaml --env-file docker_support/docker-compose.env build
      sudo docker-compose -f docker_support/docker-compose.yaml --env-file docker_support/docker-compose.env up -d
      # Use the following command to track the log
      sudo docker-compose -f docker_support/docker-compose.yaml logs -f
    

One-click Deployment in Azure

Firstly, You need to have an Azure account to deploy Qlib-Server in Azure. Then you can deploy Qlib-Server in Azure according to the following processes:

  • Install azure-cli, please refer to install-azure-cli.

  • Add the Azure account to the configuration file azure_conf.yaml

        sub_id: Your Subscription ID
        username: azure user name
        password: azure password
        # The resource group where the VM is located
        resource_group: Resource group name
    
  • Execute the deployment script by running the following command:

        git clone https://github.com/microsoft/qlib-server
        cd qlib-server/scripts
        python azure_manager.py create_qlib_cs_vm \
            --qlib_server_name test_server01 \
            --qlib_client_names test_client01 \
            --admin_username test_user \
            --ssh_key_value ~/.ssh/id_rsa.pub \
            --size standard_NV6_Promo\
            --conf_path azure_conf.yaml
    

To know more about one-click Deployment, please refer to Qlib-Server One-click Deployment.

Step-by-step Deployment

To know more about step-by-step Deployment, please refer to [Qlib-Server Step-by-step Deplyment]https://qlib-server.readthedocs.io/en/latest/build.html#step-by-step-deployment).

Using Qlib in Online Mode

In the Qlib Document, the Offline mode has been introduced.

With Qlib-Server, you can use Qlib in Online mode, please initialize Qlib with the following code:

import qlib
ONLINE_CONFIG = {
    # data provider config
    "calendar_provider": {"class": "LocalCalendarProvider", "kwargs": {"remote": True}},
    "instrument_provider": "ClientInstrumentProvider",
    "feature_provider": {"class": "LocalFeatureProvider", "kwargs": {"remote": True}},
    "expression_provider": "LocalExpressionProvider",
    "dataset_provider": "ClientDatasetProvider",
    "provider": "ClientProvider",
    # config it in user's own code
    "provider_uri": "127.0.0.1:/",
    # cache
    # Using parameter 'remote' to announce the client is using server_cache, and the writing access will be disabled.
    "expression_cache": None,
    "dataset_cache": None,
    "calendar_cache": None,
    "mount_path": "/data/stock_data/qlib_data",
    "auto_mount": True,  # The nfs is already mounted on our server[auto_mount: False].
    "flask_server": "127.0.0.1",
    "flask_port": 9710,
    "region": "cn",
}

qlib.init(**client_config)
ins = D.list_instruments(D.instrumetns("all"), as_list=True)

For more details, please refer to Qlib-Server Client.

More About Qlib-Server

The detailed documents are organized in docs. Sphinx and the readthedocs theme is required to build the documentation in html formats.

cd docs/
conda install sphinx sphinx_rtd_theme -y
# Otherwise, you can install them with pip
# pip install sphinx sphinx_rtd_theme
make html

You can also view the latest document online directly.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].