# Table of Contents - [Qlib Documentation — QLib 0.9.8.dev11 documentation](#qlib-documentation-qlib-0-9-8-dev11-documentation) - [Qlib Documentation — QLib 0.9.7 documentation](#qlib-documentation-qlib-0-9-7-documentation) - [Qlib Documentation — QLib 0.9.7 documentation](#qlib-documentation-qlib-0-9-7-documentation) - [Qlib Documentation — QLib 0.9.6 documentation](#qlib-documentation-qlib-0-9-6-documentation) - [Qlib Documentation — QLib 0.9.2 documentation](#qlib-documentation-qlib-0-9-2-documentation) - [Qlib Documentation — QLib 0.9.5 documentation](#qlib-documentation-qlib-0-9-5-documentation) - [Qlib Documentation — QLib 0.9.1 documentation](#qlib-documentation-qlib-0-9-1-documentation) - [Qlib Documentation — QLib 0.9.0 documentation](#qlib-documentation-qlib-0-9-0-documentation) - [Qlib Documentation — QLib 0.8.6 documentation](#qlib-documentation-qlib-0-8-6-documentation) - [Qlib Documentation — QLib 0.8.4.99 documentation](#qlib-documentation-qlib-0-8-4-99-documentation) - [Qlib Documentation — QLib 0.8.3 documentation](#qlib-documentation-qlib-0-8-3-documentation) - [Qlib Documentation — QLib 0.6.2 documentation](#qlib-documentation-qlib-0-6-2-documentation) - [Qlib Documentation — QLib 0.6.2 documentation](#qlib-documentation-qlib-0-6-2-documentation) - [Qlib Documentation — QLib 0.7.2 documentation](#qlib-documentation-qlib-0-7-2-documentation) - [Qlib Documentation — QLib 0.9.3 documentation](#qlib-documentation-qlib-0-9-3-documentation) - [Qlib Documentation — QLib 0.8.0.99 documentation](#qlib-documentation-qlib-0-8-0-99-documentation) - [Qlib Documentation — QLib 0.4.6.dev0 documentation](#qlib-documentation-qlib-0-4-6-dev0-documentation) - [Qlib Documentation — QLib 0.6.0 documentation](#qlib-documentation-qlib-0-6-0-documentation) - [Qlib Documentation — QLib 0.5.1 documentation](#qlib-documentation-qlib-0-5-1-documentation) - [Qlib Documentation — QLib 0.6.1 documentation](#qlib-documentation-qlib-0-6-1-documentation) - [Qlib Documentation — QLib 0.8.4 documentation](#qlib-documentation-qlib-0-8-4-documentation) - [Qlib Documentation — QLib 0.8.2 documentation](#qlib-documentation-qlib-0-8-2-documentation) - [Qlib Documentation — QLib 0.8.0 documentation](#qlib-documentation-qlib-0-8-0-documentation) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Qlib: Quantitative Platform — QLib 0.9.8.dev11 documentation](#qlib-quantitative-platform-qlib-0-9-8-dev11-documentation) - [Installation — QLib 0.9.8.dev11 documentation](#installation-qlib-0-9-8-dev11-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.8.dev11 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-8-dev11-documentation) - [Qlib Initialization — QLib 0.9.8.dev11 documentation](#qlib-initialization-qlib-0-9-8-dev11-documentation) - [Quick Start — QLib 0.9.8.dev11 documentation](#quick-start-qlib-0-9-8-dev11-documentation) - [Data Retrieval — QLib 0.9.8.dev11 documentation](#data-retrieval-qlib-0-9-8-dev11-documentation) - [Design of Nested Decision Execution Framework for High-Frequency Trading — QLib 0.9.8.dev11 documentation](#design-of-nested-decision-execution-framework-for-high-frequency-trading-qlib-0-9-8-dev11-documentation) - [Custom Model Integration — QLib 0.9.8.dev11 documentation](#custom-model-integration-qlib-0-9-8-dev11-documentation) - [Guidance — QLib 0.9.8.dev11 documentation](#guidance-qlib-0-9-8-dev11-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.8.dev11 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-8-dev11-documentation) - [Workflow: Workflow Management — QLib 0.9.8.dev11 documentation](#workflow-workflow-management-qlib-0-9-8-dev11-documentation) - [The Framework of QlibRL — QLib 0.9.8.dev11 documentation](#the-framework-of-qlibrl-qlib-0-9-8-dev11-documentation) - [Forecast Model: Model Training & Prediction — QLib 0.9.8.dev11 documentation](#forecast-model-model-training-prediction-qlib-0-9-8-dev11-documentation) - [Quick Start — QLib 0.9.8.dev11 documentation](#quick-start-qlib-0-9-8-dev11-documentation) - [Portfolio Strategy: Portfolio Management — QLib 0.9.8.dev11 documentation](#portfolio-strategy-portfolio-management-qlib-0-9-8-dev11-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.7 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-7-documentation) - [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model — QLib 0.9.8.dev11 documentation](#meta-controller-meta-task-meta-dataset-meta-model-qlib-0-9-8-dev11-documentation) - [Online & Offline mode — QLib 0.9.8.dev11 documentation](#online-offline-mode-qlib-0-9-8-dev11-documentation) - [Analysis: Evaluation & Results Analysis — QLib 0.9.8.dev11 documentation](#analysis-evaluation-results-analysis-qlib-0-9-8-dev11-documentation) - [Code Standard — QLib 0.9.8.dev11 documentation](#code-standard-qlib-0-9-8-dev11-documentation) - [Build Docker Image — QLib 0.9.8.dev11 documentation](#build-docker-image-qlib-0-9-8-dev11-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.7 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-7-documentation) - [The Framework of QlibRL — QLib 0.9.7 documentation](#the-framework-of-qlibrl-qlib-0-9-7-documentation) - [Qlib: Quantitative Platform — QLib 0.9.2 documentation](#qlib-quantitative-platform-qlib-0-9-2-documentation) - [Quick Start — QLib 0.9.7 documentation](#quick-start-qlib-0-9-7-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.7 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-7-documentation) - [Qlib Initialization — QLib 0.9.2 documentation](#qlib-initialization-qlib-0-9-2-documentation) - [Installation — QLib 0.9.2 documentation](#installation-qlib-0-9-2-documentation) - [Building Formulaic Alphas — QLib 0.9.8.dev11 documentation](#building-formulaic-alphas-qlib-0-9-8-dev11-documentation) - [Data Layer: Data Framework & Usage — QLib 0.9.8.dev11 documentation](#data-layer-data-framework-usage-qlib-0-9-8-dev11-documentation) - [(P)oint-(I)n-(T)ime Database — QLib 0.9.8.dev11 documentation](#-p-oint-i-n-t-ime-database-qlib-0-9-8-dev11-documentation) - [Serialization — QLib 0.9.8.dev11 documentation](#serialization-qlib-0-9-8-dev11-documentation) - [Guidance — QLib 0.9.7 documentation](#guidance-qlib-0-9-7-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.7 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-7-documentation) - [Quick Start — QLib 0.9.7 documentation](#quick-start-qlib-0-9-7-documentation) - [Changelog — QLib 0.9.8.dev11 documentation](#changelog-qlib-0-9-8-dev11-documentation) - [Qlib FAQ — QLib 0.9.8.dev11 documentation](#qlib-faq-qlib-0-9-8-dev11-documentation) - [Online Serving — QLib 0.9.8.dev11 documentation](#online-serving-qlib-0-9-8-dev11-documentation) - [The Framework of QlibRL — QLib 0.9.7 documentation](#the-framework-of-qlibrl-qlib-0-9-7-documentation) - [Portfolio Strategy: Portfolio Management — QLib 0.9.2 documentation](#portfolio-strategy-portfolio-management-qlib-0-9-2-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.2 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-2-documentation) - [Building Formulaic Alphas — QLib 0.9.2 documentation](#building-formulaic-alphas-qlib-0-9-2-documentation) - [Qlib: Quantitative Platform — QLib 0.9.1 documentation](#qlib-quantitative-platform-qlib-0-9-1-documentation) - [Installation — QLib 0.9.1 documentation](#installation-qlib-0-9-1-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.6 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-6-documentation) - [The Framework of QlibRL — QLib 0.9.2 documentation](#the-framework-of-qlibrl-qlib-0-9-2-documentation) - [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model — QLib 0.9.2 documentation](#meta-controller-meta-task-meta-dataset-meta-model-qlib-0-9-2-documentation) - [Qlib Initialization — QLib 0.9.1 documentation](#qlib-initialization-qlib-0-9-1-documentation) - [Guidance — QLib 0.9.7 documentation](#guidance-qlib-0-9-7-documentation) - [The Framework of QlibRL — QLib 0.9.6 documentation](#the-framework-of-qlibrl-qlib-0-9-6-documentation) - [Qlib: Quantitative Platform — QLib 0.9.5 documentation](#qlib-quantitative-platform-qlib-0-9-5-documentation) - [Qlib: Quantitative Platform — QLib 0.9.7 documentation](#qlib-quantitative-platform-qlib-0-9-7-documentation) - [Qlib Initialization — QLib 0.9.7 documentation](#qlib-initialization-qlib-0-9-7-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.6 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-6-documentation) - [Qlib Initialization — QLib 0.9.5 documentation](#qlib-initialization-qlib-0-9-5-documentation) - [Quick Start — QLib 0.9.2 documentation](#quick-start-qlib-0-9-2-documentation) - [Quick Start — QLib 0.9.6 documentation](#quick-start-qlib-0-9-6-documentation) - [Workflow: Workflow Management — QLib 0.9.2 documentation](#workflow-workflow-management-qlib-0-9-2-documentation) - [Installation — QLib 0.9.5 documentation](#installation-qlib-0-9-5-documentation) - [Data Retrieval — QLib 0.9.5 documentation](#data-retrieval-qlib-0-9-5-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.5 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-5-documentation) - [Qlib Recorder: Experiment Management — QLib 0.9.8.dev11 documentation](#qlib-recorder-experiment-management-qlib-0-9-8-dev11-documentation) - [Forecast Model: Model Training & Prediction — QLib 0.9.7 documentation](#forecast-model-model-training-prediction-qlib-0-9-7-documentation) - [Data Retrieval — QLib 0.9.7 documentation](#data-retrieval-qlib-0-9-7-documentation) - [Design of Nested Decision Execution Framework for High-Frequency Trading — QLib 0.9.7 documentation](#design-of-nested-decision-execution-framework-for-high-frequency-trading-qlib-0-9-7-documentation) - [Installation — QLib 0.9.7 documentation](#installation-qlib-0-9-7-documentation) - [Forecast Model: Model Training & Prediction — QLib 0.9.5 documentation](#forecast-model-model-training-prediction-qlib-0-9-5-documentation) - [Guidance — QLib 0.9.6 documentation](#guidance-qlib-0-9-6-documentation) - [Analysis: Evaluation & Results Analysis — QLib 0.9.2 documentation](#analysis-evaluation-results-analysis-qlib-0-9-2-documentation) - [Online & Offline mode — QLib 0.9.7 documentation](#online-offline-mode-qlib-0-9-7-documentation) - [Custom Model Integration — QLib 0.9.7 documentation](#custom-model-integration-qlib-0-9-7-documentation) - [Custom Model Integration — QLib 0.9.5 documentation](#custom-model-integration-qlib-0-9-5-documentation) - [Design of Nested Decision Execution Framework for High-Frequency Trading — QLib 0.9.5 documentation](#design-of-nested-decision-execution-framework-for-high-frequency-trading-qlib-0-9-5-documentation) - [Online Serving — QLib 0.9.2 documentation](#online-serving-qlib-0-9-2-documentation) - [Analysis: Evaluation & Results Analysis — QLib 0.9.7 documentation](#analysis-evaluation-results-analysis-qlib-0-9-7-documentation) - [Building Formulaic Alphas — QLib 0.9.7 documentation](#building-formulaic-alphas-qlib-0-9-7-documentation) - [Portfolio Strategy: Portfolio Management — QLib 0.9.5 documentation](#portfolio-strategy-portfolio-management-qlib-0-9-5-documentation) - [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model — QLib 0.9.5 documentation](#meta-controller-meta-task-meta-dataset-meta-model-qlib-0-9-5-documentation) - [Build Docker Image — QLib 0.9.7 documentation](#build-docker-image-qlib-0-9-7-documentation) - [Qlib: Quantitative Platform — QLib 0.9.7 documentation](#qlib-quantitative-platform-qlib-0-9-7-documentation) - [Portfolio Strategy: Portfolio Management — QLib 0.9.7 documentation](#portfolio-strategy-portfolio-management-qlib-0-9-7-documentation) - [Installation — QLib 0.9.7 documentation](#installation-qlib-0-9-7-documentation) - [Design of Nested Decision Execution Framework for High-Frequency Trading — QLib 0.9.7 documentation](#design-of-nested-decision-execution-framework-for-high-frequency-trading-qlib-0-9-7-documentation) - [Guidance — QLib 0.9.5 documentation](#guidance-qlib-0-9-5-documentation) - [The Framework of QlibRL — QLib 0.9.5 documentation](#the-framework-of-qlibrl-qlib-0-9-5-documentation) - [Workflow: Workflow Management — QLib 0.9.5 documentation](#workflow-workflow-management-qlib-0-9-5-documentation) - [Building Formulaic Alphas — QLib 0.9.5 documentation](#building-formulaic-alphas-qlib-0-9-5-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.5 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-5-documentation) - [Data Layer: Data Framework & Usage — QLib 0.9.2 documentation](#data-layer-data-framework-usage-qlib-0-9-2-documentation) - [Quick Start — QLib 0.9.5 documentation](#quick-start-qlib-0-9-5-documentation) - [Quick Start — QLib 0.9.7 documentation](#quick-start-qlib-0-9-7-documentation) - [Qlib FAQ — QLib 0.9.7 documentation](#qlib-faq-qlib-0-9-7-documentation) - [Quick Start — QLib 0.9.2 documentation](#quick-start-qlib-0-9-2-documentation) - [Qlib Initialization — QLib 0.9.7 documentation](#qlib-initialization-qlib-0-9-7-documentation) - [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model — QLib 0.9.7 documentation](#meta-controller-meta-task-meta-dataset-meta-model-qlib-0-9-7-documentation) - [Data Retrieval — QLib 0.9.7 documentation](#data-retrieval-qlib-0-9-7-documentation) - [Forecast Model: Model Training & Prediction — QLib 0.9.7 documentation](#forecast-model-model-training-prediction-qlib-0-9-7-documentation) - [Building Formulaic Alphas — QLib 0.9.7 documentation](#building-formulaic-alphas-qlib-0-9-7-documentation) - [Code Standard — QLib 0.9.7 documentation](#code-standard-qlib-0-9-7-documentation) - [Qlib: Quantitative Platform — QLib 0.9.6 documentation](#qlib-quantitative-platform-qlib-0-9-6-documentation) - [Serialization — QLib 0.9.7 documentation](#serialization-qlib-0-9-7-documentation) - [Code Standard — QLib 0.9.7 documentation](#code-standard-qlib-0-9-7-documentation) - [Design of Nested Decision Execution Framework for High-Frequency Trading — QLib 0.9.2 documentation](#design-of-nested-decision-execution-framework-for-high-frequency-trading-qlib-0-9-2-documentation) - [Custom Model Integration — QLib 0.9.2 documentation](#custom-model-integration-qlib-0-9-2-documentation) - [Analysis: Evaluation & Results Analysis — QLib 0.9.5 documentation](#analysis-evaluation-results-analysis-qlib-0-9-5-documentation) - [Qlib Recorder: Experiment Management — QLib 0.9.2 documentation](#qlib-recorder-experiment-management-qlib-0-9-2-documentation) - [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model — QLib 0.9.7 documentation](#meta-controller-meta-task-meta-dataset-meta-model-qlib-0-9-7-documentation) - [(P)oint-(I)n-(T)ime Database — QLib 0.9.7 documentation](#-p-oint-i-n-t-ime-database-qlib-0-9-7-documentation) - [Analysis: Evaluation & Results Analysis — QLib 0.9.7 documentation](#analysis-evaluation-results-analysis-qlib-0-9-7-documentation) - [Build Docker Image — QLib 0.9.7 documentation](#build-docker-image-qlib-0-9-7-documentation) - [Changelog — QLib 0.9.7 documentation](#changelog-qlib-0-9-7-documentation) - [Changelog — QLib 0.9.7 documentation](#changelog-qlib-0-9-7-documentation) - [(P)oint-(I)n-(T)ime Database — QLib 0.9.7 documentation](#-p-oint-i-n-t-ime-database-qlib-0-9-7-documentation) - [Online & Offline mode — QLib 0.9.7 documentation](#online-offline-mode-qlib-0-9-7-documentation) - [Qlib FAQ — QLib 0.9.7 documentation](#qlib-faq-qlib-0-9-7-documentation) - [Serialization — QLib 0.9.7 documentation](#serialization-qlib-0-9-7-documentation) - [Data Retrieval — QLib 0.9.6 documentation](#data-retrieval-qlib-0-9-6-documentation) - [Custom Model Integration — QLib 0.9.7 documentation](#custom-model-integration-qlib-0-9-7-documentation) - [Custom Model Integration — QLib 0.9.6 documentation](#custom-model-integration-qlib-0-9-6-documentation) - [Portfolio Strategy: Portfolio Management — QLib 0.9.7 documentation](#portfolio-strategy-portfolio-management-qlib-0-9-7-documentation) - [Installation — QLib 0.9.6 documentation](#installation-qlib-0-9-6-documentation) - [Task Management — QLib 0.9.8.dev11 documentation](#task-management-qlib-0-9-8-dev11-documentation) - [Forecast Model: Model Training & Prediction — QLib 0.9.6 documentation](#forecast-model-model-training-prediction-qlib-0-9-6-documentation) - [Online Serving — QLib 0.9.7 documentation](#online-serving-qlib-0-9-7-documentation) - [Online & Offline mode — QLib 0.9.6 documentation](#online-offline-mode-qlib-0-9-6-documentation) - [Building Formulaic Alphas — QLib 0.9.6 documentation](#building-formulaic-alphas-qlib-0-9-6-documentation) - [Code Standard — QLib 0.9.6 documentation](#code-standard-qlib-0-9-6-documentation) - [Quick Start — QLib 0.9.1 documentation](#quick-start-qlib-0-9-1-documentation) - [Serialization — QLib 0.9.6 documentation](#serialization-qlib-0-9-6-documentation) - [Qlib Initialization — QLib 0.9.6 documentation](#qlib-initialization-qlib-0-9-6-documentation) - [Analysis: Evaluation & Results Analysis — QLib 0.9.6 documentation](#analysis-evaluation-results-analysis-qlib-0-9-6-documentation) - [Build Docker Image — QLib 0.9.6 documentation](#build-docker-image-qlib-0-9-6-documentation) - [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model — QLib 0.9.6 documentation](#meta-controller-meta-task-meta-dataset-meta-model-qlib-0-9-6-documentation) - [Quick Start — QLib 0.9.5 documentation](#quick-start-qlib-0-9-5-documentation) - [Portfolio Strategy: Portfolio Management — QLib 0.9.6 documentation](#portfolio-strategy-portfolio-management-qlib-0-9-6-documentation) - [Forecast Model: Model Training & Prediction — QLib 0.9.2 documentation](#forecast-model-model-training-prediction-qlib-0-9-2-documentation) - [(P)oint-(I)n-(T)ime Database — QLib 0.9.6 documentation](#-p-oint-i-n-t-ime-database-qlib-0-9-6-documentation) - [Workflow: Workflow Management — QLib 0.9.7 documentation](#workflow-workflow-management-qlib-0-9-7-documentation) - [Design of Nested Decision Execution Framework for High-Frequency Trading — QLib 0.9.6 documentation](#design-of-nested-decision-execution-framework-for-high-frequency-trading-qlib-0-9-6-documentation) - [Workflow: Workflow Management — QLib 0.9.6 documentation](#workflow-workflow-management-qlib-0-9-6-documentation) - [Reinforcement Learning in Quantitative Trading — QLib 0.9.2 documentation](#reinforcement-learning-in-quantitative-trading-qlib-0-9-2-documentation) - [Online Serving — QLib 0.9.5 documentation](#online-serving-qlib-0-9-5-documentation) - [Data Retrieval — QLib 0.9.2 documentation](#data-retrieval-qlib-0-9-2-documentation) - [Qlib Recorder: Experiment Management — QLib 0.9.7 documentation](#qlib-recorder-experiment-management-qlib-0-9-7-documentation) - [Qlib FAQ — QLib 0.9.6 documentation](#qlib-faq-qlib-0-9-6-documentation) - [Changelog — QLib 0.9.6 documentation](#changelog-qlib-0-9-6-documentation) - [Data Layer: Data Framework & Usage — QLib 0.9.7 documentation](#data-layer-data-framework-usage-qlib-0-9-7-documentation) - [Online Serving — QLib 0.9.7 documentation](#online-serving-qlib-0-9-7-documentation) - [Data Layer: Data Framework & Usage — QLib 0.9.5 documentation](#data-layer-data-framework-usage-qlib-0-9-5-documentation) - [Qlib Recorder: Experiment Management — QLib 0.9.5 documentation](#qlib-recorder-experiment-management-qlib-0-9-5-documentation) - [Workflow: Workflow Management — QLib 0.9.7 documentation](#workflow-workflow-management-qlib-0-9-7-documentation) - [Quick Start — QLib 0.9.7 documentation](#quick-start-qlib-0-9-7-documentation) - [Online Serving — QLib 0.9.6 documentation](#online-serving-qlib-0-9-6-documentation) - [Data Layer: Data Framework & Usage — QLib 0.9.7 documentation](#data-layer-data-framework-usage-qlib-0-9-7-documentation) - [Data Layer: Data Framework & Usage — QLib 0.9.6 documentation](#data-layer-data-framework-usage-qlib-0-9-6-documentation) - [Qlib Recorder: Experiment Management — QLib 0.9.7 documentation](#qlib-recorder-experiment-management-qlib-0-9-7-documentation) - [Quick Start — QLib 0.9.6 documentation](#quick-start-qlib-0-9-6-documentation) - [Task Management — QLib 0.9.7 documentation](#task-management-qlib-0-9-7-documentation) - [Qlib Recorder: Experiment Management — QLib 0.9.6 documentation](#qlib-recorder-experiment-management-qlib-0-9-6-documentation) - [Task Management — QLib 0.9.6 documentation](#task-management-qlib-0-9-6-documentation) - [Task Management — QLib 0.9.7 documentation](#task-management-qlib-0-9-7-documentation) - [API Reference — QLib 0.9.7 documentation](#api-reference-qlib-0-9-7-documentation) --- # Qlib Documentation — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/#) * `Qlib` Documentation * [View page source](https://qlib.readthedocs.io/en/latest/_sources/index.rst.txt) * * * `Qlib` Documentation[](https://qlib.readthedocs.io/en/latest/#qlib-documentation "Permalink to this heading") =============================================================================================================== `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. Document Structure[](https://qlib.readthedocs.io/en/latest/#document-structure "Permalink to this heading") ------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/latest/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/latest/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/latest/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/latest/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/latest/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/latest/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/latest/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/latest/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/latest/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/latest/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/latest/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/latest/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/latest/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/latest/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/latest/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/latest/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/latest/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/latest/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/latest/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/latest/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/latest/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/latest/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/latest/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/latest/start/integration.html#reference) MAIN COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/latest/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/latest/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/latest/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/latest/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/latest/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/latest/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/latest/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/latest/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/latest/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/latest/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/latest/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/latest/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV and Parquet Format into Qlib Format](https://qlib.readthedocs.io/en/latest/component/data.html#converting-csv-and-parquet-format-into-qlib-format) * [Checking the health of the data](https://qlib.readthedocs.io/en/latest/component/data.html#checking-the-health-of-the-data) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/latest/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/latest/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/latest/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/latest/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/latest/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/latest/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/latest/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/latest/component/data.html#id6) * [QlibDataLoader](https://qlib.readthedocs.io/en/latest/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/latest/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/latest/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/latest/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/latest/component/data.html#id7) * [DataHandlerLP](https://qlib.readthedocs.io/en/latest/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/latest/component/data.html#id8) * [Processor](https://qlib.readthedocs.io/en/latest/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/latest/component/data.html#example) * [API](https://qlib.readthedocs.io/en/latest/component/data.html#id11) * [Dataset](https://qlib.readthedocs.io/en/latest/component/data.html#id12) * [API](https://qlib.readthedocs.io/en/latest/component/data.html#id13) * [Cache](https://qlib.readthedocs.io/en/latest/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/latest/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/latest/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/latest/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/latest/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/latest/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/latest/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/latest/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/latest/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/latest/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/latest/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/latest/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/latest/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/latest/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/latest/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/latest/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/latest/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/latest/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/latest/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/latest/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/latest/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/latest/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/latest/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/latest/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/latest/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/latest/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/latest/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/latest/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/latest/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-task) * [`MetaTask`](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.task.MetaTask) * [Meta Dataset](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-dataset) * [`MetaTaskDataset`](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.dataset.MetaTaskDataset) * [Meta Model](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/latest/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/latest/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/latest/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/latest/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/latest/component/recorder.html#qlib-recorder) * [`QlibRecorder`](https://qlib.readthedocs.io/en/latest/component/recorder.html#qlib.workflow.__init__.QlibRecorder) * [Experiment Manager](https://qlib.readthedocs.io/en/latest/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/latest/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/latest/component/recorder.html#id1) * [Record Template](https://qlib.readthedocs.io/en/latest/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/latest/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/latest/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/latest/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/latest/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/latest/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/latest/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/latest/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/latest/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/latest/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/latest/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/latest/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/latest/component/online.html#id3) * [Online Strategy](https://qlib.readthedocs.io/en/latest/component/online.html#id7) * [Online Tool](https://qlib.readthedocs.io/en/latest/component/online.html#id11) * [Updater](https://qlib.readthedocs.io/en/latest/component/online.html#id12) * [Reinforcement Learning](https://qlib.readthedocs.io/en/latest/component/rl/toctree.html) * [Guidance](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html) * [Beginners to Reinforcement Learning Algorithms](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html#beginners-to-reinforcement-learning-algorithms) * [Reinforcement Learning Algorithm Researcher](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html#reinforcement-learning-algorithm-researcher) * [Quantitative Researcher](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html#quantitative-researcher) * [Overall](https://qlib.readthedocs.io/en/latest/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Quick Start](https://qlib.readthedocs.io/en/latest/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/latest/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/latest/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/latest/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/latest/component/rl/framework.html#training-vessel-trainer) OTHER COMPONENTS/FEATURES/TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/latest/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/latest/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/latest/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/latest/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/latest/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/latest/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/latest/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/latest/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/latest/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/latest/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/latest/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/latest/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/latest/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/latest/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/latest/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/latest/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/latest/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/latest/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/latest/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/latest/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/latest/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/latest/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/latest/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/latest/advanced/PIT.html#file-based-design-for-pit-data) FOR DEVELOPERS: * [Code Standard](https://qlib.readthedocs.io/en/latest/developer/code_standard_and_dev_guide.html) * [Docstring](https://qlib.readthedocs.io/en/latest/developer/code_standard_and_dev_guide.html#docstring) * [Continuous Integration](https://qlib.readthedocs.io/en/latest/developer/code_standard_and_dev_guide.html#continuous-integration) * [Development Guidance](https://qlib.readthedocs.io/en/latest/developer/code_standard_and_dev_guide.html#development-guidance) * [How to build image](https://qlib.readthedocs.io/en/latest/developer/how_to_build_image.html) * [Dockerfile](https://qlib.readthedocs.io/en/latest/developer/how_to_build_image.html#dockerfile) * [Auto build of qlib images](https://qlib.readthedocs.io/en/latest/developer/how_to_build_image.html#auto-build-of-qlib-images) * [How to use qlib images](https://qlib.readthedocs.io/en/latest/developer/how_to_build_image.html#how-to-use-qlib-images) REFERENCE: * [API](https://qlib.readthedocs.io/en/latest/reference/api.html) * [Data](https://qlib.readthedocs.io/en/latest/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/latest/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/latest/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/latest/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/latest/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.contrib.strategy) * [Evaluate](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/latest/reference/api.html#report) * [Workflow](https://qlib.readthedocs.io/en/latest/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/latest/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/latest/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/latest/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/latest/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/latest/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/latest/reference/api.html#id5) * [Online Tool](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/latest/reference/api.html#id10) * [Serializable](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.utils.serial) * [RL](https://qlib.readthedocs.io/en/latest/reference/api.html#rl) * [Base Component](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.rl) * [Strategy](https://qlib.readthedocs.io/en/latest/reference/api.html#id11) * [Trainer](https://qlib.readthedocs.io/en/latest/reference/api.html#id12) * [Order Execution](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.rl.order_execution) * [Utils](https://qlib.readthedocs.io/en/latest/reference/api.html#id13) * [FAQ](https://qlib.readthedocs.io/en/latest/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/latest/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/latest/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/latest/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/latest/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/latest/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/latest/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/latest/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/latest/changelog/changelog.html#other-versions) [**Build fast. Ship faster.** Send SMS and more with just a few lines of code. **Test it for free.**](https://server.ethicalads.io/proxy/click/10197/019d687f-4161-7a93-9529-78e9252253aa/) [Ads by EthicalAds](https://www.ethicalads.io/advertisers/topics/data-science/?ref=ea-text) Close Ad --- # Qlib Documentation — QLib 0.9.7 documentation * [](https://qlib.readthedocs.io/en/v0.9.7/#) * `Qlib` Documentation * [View page source](https://qlib.readthedocs.io/en/v0.9.7/_sources/index.rst.txt) * * * `Qlib` Documentation[](https://qlib.readthedocs.io/en/v0.9.7/#qlib-documentation "Permalink to this heading") =============================================================================================================== `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. Document Structure[](https://qlib.readthedocs.io/en/v0.9.7/#document-structure "Permalink to this heading") ------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.9.7/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.7/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.9.7/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.9.7/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.9.7/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.7/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.9.7/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.9.7/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.9.7/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.9.7/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.9.7/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.7/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.9.7/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.9.7/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.7/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.9.7/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.7/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.9.7/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.9.7/start/integration.html#reference) MAIN COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.9.7/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.9.7/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.7/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.9.7/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.9.7/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.9.7/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV and Parquet Format into Qlib Format](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#converting-csv-and-parquet-format-into-qlib-format) * [Checking the health of the data](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#checking-the-health-of-the-data) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#id6) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#id7) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#id8) * [Processor](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#id11) * [Dataset](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#id12) * [API](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#id13) * [Cache](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.9.7/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.9.7/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.7/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.9.7/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.9.7/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.9.7/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.9.7/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.9.7/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.9.7/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html#meta-task) * [`MetaTask`](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html#qlib.model.meta.task.MetaTask) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html#meta-dataset) * [`MetaTaskDataset`](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html#qlib.model.meta.dataset.MetaTaskDataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.9.7/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.9.7/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.9.7/component/recorder.html#qlib-recorder) * [`QlibRecorder`](https://qlib.readthedocs.io/en/v0.9.7/component/recorder.html#qlib.workflow.__init__.QlibRecorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.7/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.7/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.7/component/recorder.html#id1) * [Record Template](https://qlib.readthedocs.io/en/v0.9.7/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/v0.9.7/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.9.7/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.9.7/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.7/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.9.7/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.9.7/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.9.7/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.9.7/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.9.7/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.7/component/online.html#id3) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.7/component/online.html#id7) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.7/component/online.html#id11) * [Updater](https://qlib.readthedocs.io/en/v0.9.7/component/online.html#id12) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.7/component/rl/toctree.html) * [Guidance](https://qlib.readthedocs.io/en/v0.9.7/component/rl/guidance.html) * [Beginners to Reinforcement Learning Algorithms](https://qlib.readthedocs.io/en/v0.9.7/component/rl/guidance.html#beginners-to-reinforcement-learning-algorithms) * [Reinforcement Learning Algorithm Researcher](https://qlib.readthedocs.io/en/v0.9.7/component/rl/guidance.html#reinforcement-learning-algorithm-researcher) * [Quantitative Researcher](https://qlib.readthedocs.io/en/v0.9.7/component/rl/guidance.html#quantitative-researcher) * [Overall](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.7/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html#training-vessel-trainer) OTHER COMPONENTS/FEATURES/TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.9.7/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.9.7/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.9.7/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.9.7/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.9.7/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.9.7/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.9.7/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.9.7/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.9.7/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.9.7/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.7/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.9.7/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.9.7/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.9.7/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.9.7/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.9.7/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/v0.9.7/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.7/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.7/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/v0.9.7/advanced/PIT.html#file-based-design-for-pit-data) FOR DEVELOPERS: * [Code Standard](https://qlib.readthedocs.io/en/v0.9.7/developer/code_standard_and_dev_guide.html) * [Docstring](https://qlib.readthedocs.io/en/v0.9.7/developer/code_standard_and_dev_guide.html#docstring) * [Continuous Integration](https://qlib.readthedocs.io/en/v0.9.7/developer/code_standard_and_dev_guide.html#continuous-integration) * [Development Guidance](https://qlib.readthedocs.io/en/v0.9.7/developer/code_standard_and_dev_guide.html#development-guidance) * [How to build image](https://qlib.readthedocs.io/en/v0.9.7/developer/how_to_build_image.html) * [Dockerfile](https://qlib.readthedocs.io/en/v0.9.7/developer/how_to_build_image.html#dockerfile) * [Auto build of qlib images](https://qlib.readthedocs.io/en/v0.9.7/developer/how_to_build_image.html#auto-build-of-qlib-images) * [How to use qlib images](https://qlib.readthedocs.io/en/v0.9.7/developer/how_to_build_image.html#how-to-use-qlib-images) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.contrib.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#report) * [Workflow](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#id5) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#id10) * [Serializable](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.utils.serial) * [RL](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#rl) * [Base Component](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.rl) * [Strategy](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#id11) * [Trainer](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#id12) * [Order Execution](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.rl.order_execution) * [Utils](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#id13) * [FAQ](https://qlib.readthedocs.io/en/v0.9.7/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.9.7/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.9.7/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.9.7/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.9.7/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.9.7/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.9.7/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.9.7/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.9.7 documentation * [](https://qlib.readthedocs.io/en/stable/#) * `Qlib` Documentation * [View page source](https://qlib.readthedocs.io/en/stable/_sources/index.rst.txt) * * * `Qlib` Documentation[](https://qlib.readthedocs.io/en/stable/#qlib-documentation "Permalink to this heading") =============================================================================================================== `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. Document Structure[](https://qlib.readthedocs.io/en/stable/#document-structure "Permalink to this heading") ------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/stable/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/stable/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/stable/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/stable/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/stable/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/stable/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/stable/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/stable/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/stable/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/stable/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/stable/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/stable/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/stable/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/stable/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/stable/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/stable/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/stable/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/stable/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/stable/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/stable/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/stable/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/stable/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/stable/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/stable/start/integration.html#reference) MAIN COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/stable/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/stable/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/stable/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/stable/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/stable/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/stable/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/stable/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/stable/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/stable/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/stable/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/stable/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/stable/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV and Parquet Format into Qlib Format](https://qlib.readthedocs.io/en/stable/component/data.html#converting-csv-and-parquet-format-into-qlib-format) * [Checking the health of the data](https://qlib.readthedocs.io/en/stable/component/data.html#checking-the-health-of-the-data) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/stable/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/stable/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/stable/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/stable/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/stable/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/stable/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/stable/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/stable/component/data.html#id6) * [QlibDataLoader](https://qlib.readthedocs.io/en/stable/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/stable/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/stable/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/stable/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/stable/component/data.html#id7) * [DataHandlerLP](https://qlib.readthedocs.io/en/stable/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/stable/component/data.html#id8) * [Processor](https://qlib.readthedocs.io/en/stable/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/stable/component/data.html#example) * [API](https://qlib.readthedocs.io/en/stable/component/data.html#id11) * [Dataset](https://qlib.readthedocs.io/en/stable/component/data.html#id12) * [API](https://qlib.readthedocs.io/en/stable/component/data.html#id13) * [Cache](https://qlib.readthedocs.io/en/stable/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/stable/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/stable/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/stable/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/stable/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/stable/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/stable/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/stable/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/stable/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/stable/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/stable/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/stable/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/stable/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/stable/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/stable/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/stable/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/stable/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/stable/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/stable/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/stable/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/stable/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/stable/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/stable/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/stable/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/stable/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/stable/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/stable/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/stable/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/stable/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/stable/component/meta.html#meta-task) * [`MetaTask`](https://qlib.readthedocs.io/en/stable/component/meta.html#qlib.model.meta.task.MetaTask) * [Meta Dataset](https://qlib.readthedocs.io/en/stable/component/meta.html#meta-dataset) * [`MetaTaskDataset`](https://qlib.readthedocs.io/en/stable/component/meta.html#qlib.model.meta.dataset.MetaTaskDataset) * [Meta Model](https://qlib.readthedocs.io/en/stable/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/stable/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/stable/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/stable/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/stable/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/stable/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/stable/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/stable/component/recorder.html#qlib-recorder) * [`QlibRecorder`](https://qlib.readthedocs.io/en/stable/component/recorder.html#qlib.workflow.__init__.QlibRecorder) * [Experiment Manager](https://qlib.readthedocs.io/en/stable/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/stable/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/stable/component/recorder.html#id1) * [Record Template](https://qlib.readthedocs.io/en/stable/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/stable/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/stable/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/stable/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/stable/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/stable/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/stable/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/stable/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/stable/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/stable/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/stable/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/stable/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/stable/component/online.html#id3) * [Online Strategy](https://qlib.readthedocs.io/en/stable/component/online.html#id7) * [Online Tool](https://qlib.readthedocs.io/en/stable/component/online.html#id11) * [Updater](https://qlib.readthedocs.io/en/stable/component/online.html#id12) * [Reinforcement Learning](https://qlib.readthedocs.io/en/stable/component/rl/toctree.html) * [Guidance](https://qlib.readthedocs.io/en/stable/component/rl/guidance.html) * [Beginners to Reinforcement Learning Algorithms](https://qlib.readthedocs.io/en/stable/component/rl/guidance.html#beginners-to-reinforcement-learning-algorithms) * [Reinforcement Learning Algorithm Researcher](https://qlib.readthedocs.io/en/stable/component/rl/guidance.html#reinforcement-learning-algorithm-researcher) * [Quantitative Researcher](https://qlib.readthedocs.io/en/stable/component/rl/guidance.html#quantitative-researcher) * [Overall](https://qlib.readthedocs.io/en/stable/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/stable/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/stable/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Quick Start](https://qlib.readthedocs.io/en/stable/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/stable/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/stable/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/stable/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/stable/component/rl/framework.html#training-vessel-trainer) OTHER COMPONENTS/FEATURES/TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/stable/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/stable/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/stable/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/stable/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/stable/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/stable/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/stable/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/stable/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/stable/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/stable/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/stable/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/stable/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/stable/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/stable/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/stable/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/stable/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/stable/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/stable/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/stable/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/stable/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/stable/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/stable/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/stable/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/stable/advanced/PIT.html#file-based-design-for-pit-data) FOR DEVELOPERS: * [Code Standard](https://qlib.readthedocs.io/en/stable/developer/code_standard_and_dev_guide.html) * [Docstring](https://qlib.readthedocs.io/en/stable/developer/code_standard_and_dev_guide.html#docstring) * [Continuous Integration](https://qlib.readthedocs.io/en/stable/developer/code_standard_and_dev_guide.html#continuous-integration) * [Development Guidance](https://qlib.readthedocs.io/en/stable/developer/code_standard_and_dev_guide.html#development-guidance) * [How to build image](https://qlib.readthedocs.io/en/stable/developer/how_to_build_image.html) * [Dockerfile](https://qlib.readthedocs.io/en/stable/developer/how_to_build_image.html#dockerfile) * [Auto build of qlib images](https://qlib.readthedocs.io/en/stable/developer/how_to_build_image.html#auto-build-of-qlib-images) * [How to use qlib images](https://qlib.readthedocs.io/en/stable/developer/how_to_build_image.html#how-to-use-qlib-images) REFERENCE: * [API](https://qlib.readthedocs.io/en/stable/reference/api.html) * [Data](https://qlib.readthedocs.io/en/stable/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/stable/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/stable/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/stable/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/stable/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.contrib.strategy) * [Evaluate](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/stable/reference/api.html#report) * [Workflow](https://qlib.readthedocs.io/en/stable/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/stable/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/stable/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/stable/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/stable/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/stable/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/stable/reference/api.html#id5) * [Online Tool](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/stable/reference/api.html#id10) * [Serializable](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.utils.serial) * [RL](https://qlib.readthedocs.io/en/stable/reference/api.html#rl) * [Base Component](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.rl) * [Strategy](https://qlib.readthedocs.io/en/stable/reference/api.html#id11) * [Trainer](https://qlib.readthedocs.io/en/stable/reference/api.html#id12) * [Order Execution](https://qlib.readthedocs.io/en/stable/reference/api.html#module-qlib.rl.order_execution) * [Utils](https://qlib.readthedocs.io/en/stable/reference/api.html#id13) * [FAQ](https://qlib.readthedocs.io/en/stable/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/stable/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/stable/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/stable/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/stable/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/stable/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/stable/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/stable/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/stable/changelog/changelog.html#other-versions) [**Build fast. Ship faster.** Send SMS and more with just a few lines of code. **Test it for free.**](https://server.ethicalads.io/proxy/click/10197/019d687f-4161-7a93-9529-78e9252253aa/) [Ads by EthicalAds](https://www.ethicalads.io/advertisers/topics/data-science/?ref=ea-text) Close Ad ![](https://server.ethicalads.io/proxy/view/10197/019d687f-4161-7a93-9529-78e9252253aa/) --- # Qlib Documentation — QLib 0.9.6 documentation * [](https://qlib.readthedocs.io/en/v0.9.6/#) * `Qlib` Documentation * [View page source](https://qlib.readthedocs.io/en/v0.9.6/_sources/index.rst.txt) * * * `Qlib` Documentation[](https://qlib.readthedocs.io/en/v0.9.6/#qlib-documentation "Permalink to this heading") =============================================================================================================== `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. Document Structure[](https://qlib.readthedocs.io/en/v0.9.6/#document-structure "Permalink to this heading") ------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.9.6/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.6/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.9.6/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.9.6/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.9.6/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.6/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.9.6/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.9.6/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.9.6/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.9.6/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.9.6/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.6/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.9.6/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.9.6/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.6/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.9.6/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.6/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.9.6/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.9.6/start/integration.html#reference) MAIN COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.9.6/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.9.6/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.6/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.9.6/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.9.6/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.9.6/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#id7) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#id8) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#id9) * [Processor](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#id12) * [Dataset](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#id13) * [API](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#id14) * [Cache](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.9.6/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.9.6/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.6/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.9.6/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.9.6/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.9.6/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.9.6/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.9.6/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.9.6/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html#meta-task) * [`MetaTask`](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html#qlib.model.meta.task.MetaTask) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html#meta-dataset) * [`MetaTaskDataset`](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html#qlib.model.meta.dataset.MetaTaskDataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.9.6/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.9.6/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.9.6/component/recorder.html#qlib-recorder) * [`QlibRecorder`](https://qlib.readthedocs.io/en/v0.9.6/component/recorder.html#qlib.workflow.__init__.QlibRecorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.6/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.6/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.6/component/recorder.html#id1) * [Record Template](https://qlib.readthedocs.io/en/v0.9.6/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/v0.9.6/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.9.6/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.9.6/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.6/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.9.6/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.9.6/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.9.6/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.9.6/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.9.6/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.6/component/online.html#id3) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.6/component/online.html#id7) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.6/component/online.html#id11) * [Updater](https://qlib.readthedocs.io/en/v0.9.6/component/online.html#id12) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.6/component/rl/toctree.html) * [Guidance](https://qlib.readthedocs.io/en/v0.9.6/component/rl/guidance.html) * [Beginners to Reinforcement Learning Algorithms](https://qlib.readthedocs.io/en/v0.9.6/component/rl/guidance.html#beginners-to-reinforcement-learning-algorithms) * [Reinforcement Learning Algorithm Researcher](https://qlib.readthedocs.io/en/v0.9.6/component/rl/guidance.html#reinforcement-learning-algorithm-researcher) * [Quantitative Researcher](https://qlib.readthedocs.io/en/v0.9.6/component/rl/guidance.html#quantitative-researcher) * [Overall](https://qlib.readthedocs.io/en/v0.9.6/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.6/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.6/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.6/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/v0.9.6/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/v0.9.6/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/v0.9.6/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/v0.9.6/component/rl/framework.html#training-vessel-trainer) OTHER COMPONENTS/FEATURES/TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.9.6/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.9.6/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.9.6/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.9.6/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.9.6/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.9.6/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.9.6/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.9.6/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.9.6/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.9.6/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.6/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.9.6/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.9.6/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.9.6/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.9.6/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.9.6/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/v0.9.6/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.6/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.6/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/v0.9.6/advanced/PIT.html#file-based-design-for-pit-data) FOR DEVELOPERS: * [Code Standard](https://qlib.readthedocs.io/en/v0.9.6/developer/code_standard_and_dev_guide.html) * [Docstring](https://qlib.readthedocs.io/en/v0.9.6/developer/code_standard_and_dev_guide.html#docstring) * [Continuous Integration](https://qlib.readthedocs.io/en/v0.9.6/developer/code_standard_and_dev_guide.html#continuous-integration) * [Development Guidance](https://qlib.readthedocs.io/en/v0.9.6/developer/code_standard_and_dev_guide.html#development-guidance) * [How to build image](https://qlib.readthedocs.io/en/v0.9.6/developer/how_to_build_image.html) * [Dockerfile](https://qlib.readthedocs.io/en/v0.9.6/developer/how_to_build_image.html#dockerfile) * [Auto build of qlib images](https://qlib.readthedocs.io/en/v0.9.6/developer/how_to_build_image.html#auto-build-of-qlib-images) * [How to use qlib images](https://qlib.readthedocs.io/en/v0.9.6/developer/how_to_build_image.html#how-to-use-qlib-images) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.contrib.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#report) * [Workflow](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#id5) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#id10) * [Serializable](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.utils.serial) * [RL](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#rl) * [Base Component](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.rl) * [Strategy](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#id11) * [Trainer](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#id12) * [Order Execution](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#module-qlib.rl.order_execution) * [Utils](https://qlib.readthedocs.io/en/v0.9.6/reference/api.html#id13) * [FAQ](https://qlib.readthedocs.io/en/v0.9.6/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.9.6/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.9.6/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.9.6/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.9.6/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.9.6/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.9.6/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.9.6/changelog/changelog.html#other-versions) [**Build fast. Ship faster.** Send SMS and more with just a few lines of code. **Test it for free.**](https://server.ethicalads.io/proxy/click/10197/019d687f-4161-7a93-9529-78e9252253aa/) [Ads by EthicalAds](https://www.ethicalads.io/advertisers/topics/data-science/?ref=ea-text) Close Ad ![](https://server.ethicalads.io/proxy/view/10197/019d687f-4161-7a93-9529-78e9252253aa/) --- # Qlib Documentation — QLib 0.9.2 documentation * [Docs](https://qlib.readthedocs.io/en/v0.9.2/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.9.2/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.9.2/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.9.2/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.9.2/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.2/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.9.2/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.9.2/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.9.2/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.2/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.9.2/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.9.2/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.9.2/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.9.2/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.9.2/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.2/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.9.2/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.9.2/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.2/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.9.2/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.2/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.9.2/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.9.2/start/integration.html#reference) MAIN COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.9.2/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.9.2/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.2/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.9.2/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.9.2/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.9.2/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#id7) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#id8) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#id9) * [Processor](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#id12) * [Dataset](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#id13) * [API](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#id14) * [Cache](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.9.2/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.2/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.9.2/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.9.2/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.9.2/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.9.2/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.9.2/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.9.2/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.9.2/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.9.2/component/meta.html#meta-task) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.9.2/component/meta.html#meta-dataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.9.2/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.9.2/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.9.2/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.9.2/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.9.2/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.9.2/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.9.2/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.2/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.2/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.2/component/recorder.html#id1) * [Record Template](https://qlib.readthedocs.io/en/v0.9.2/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/v0.9.2/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.9.2/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.9.2/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.2/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.9.2/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.9.2/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.9.2/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.9.2/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.9.2/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.2/component/online.html#id3) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.2/component/online.html#id7) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.2/component/online.html#id11) * [Updater](https://qlib.readthedocs.io/en/v0.9.2/component/online.html#id12) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.2/component/rl/toctree.html) * [Overall](https://qlib.readthedocs.io/en/v0.9.2/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.2/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.2/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.2/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/v0.9.2/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/v0.9.2/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/v0.9.2/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/v0.9.2/component/rl/framework.html#training-vessel-trainer) OTHER COMPONENTS/FEATURES/TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.9.2/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.9.2/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.9.2/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.9.2/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.9.2/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.9.2/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.9.2/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.9.2/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.9.2/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.9.2/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.2/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.9.2/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.9.2/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.9.2/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.9.2/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.9.2/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/v0.9.2/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.2/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.2/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/v0.9.2/advanced/PIT.html#file-based-design-for-pit-data) FOR DEVELOPERS: * [Code Standard](https://qlib.readthedocs.io/en/v0.9.2/developer/code_standard_and_dev_guide.html) * [Docstring](https://qlib.readthedocs.io/en/v0.9.2/developer/code_standard_and_dev_guide.html#docstring) * [Continuous Integration](https://qlib.readthedocs.io/en/v0.9.2/developer/code_standard_and_dev_guide.html#continuous-integration) * [Development Guidance](https://qlib.readthedocs.io/en/v0.9.2/developer/code_standard_and_dev_guide.html#development-guidance) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.contrib.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#id5) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#id10) * [Serializable](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.utils.serial) * [RL](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#rl) * [Base Component](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.rl) * [Strategy](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#id11) * [Trainer](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#id12) * [Order Execution](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#module-qlib.rl.order_execution) * [Utils](https://qlib.readthedocs.io/en/v0.9.2/reference/api.html#id13) * [FAQ](https://qlib.readthedocs.io/en/v0.9.2/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.9.2/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.9.2/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.9.2/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.9.2/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.9.2/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.9.2/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.9.2/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.9.5 documentation * [](https://qlib.readthedocs.io/en/v0.9.5/#) * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.9.5/docs/index.rst) * * * `Qlib` Documentation[](https://qlib.readthedocs.io/en/v0.9.5/#qlib-documentation "Permalink to this heading") =============================================================================================================== `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. Document Structure[](https://qlib.readthedocs.io/en/v0.9.5/#document-structure "Permalink to this heading") ------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.9.5/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.5/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.9.5/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.9.5/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.9.5/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.5/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.9.5/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.9.5/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.9.5/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.9.5/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.9.5/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.5/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.9.5/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.9.5/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.5/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.9.5/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.5/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.9.5/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.9.5/start/integration.html#reference) MAIN COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.9.5/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.9.5/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.5/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.9.5/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.9.5/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.9.5/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#id7) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#id8) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#id9) * [Processor](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#id12) * [Dataset](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#id13) * [API](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#id14) * [Cache](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.9.5/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.9.5/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.5/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.9.5/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.9.5/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.9.5/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.9.5/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.9.5/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.9.5/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html#meta-task) * [`MetaTask`](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html#qlib.model.meta.task.MetaTask) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html#meta-dataset) * [`MetaTaskDataset`](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html#qlib.model.meta.dataset.MetaTaskDataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.9.5/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.9.5/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.9.5/component/recorder.html#qlib-recorder) * [`QlibRecorder`](https://qlib.readthedocs.io/en/v0.9.5/component/recorder.html#qlib.workflow.__init__.QlibRecorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.5/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.5/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.5/component/recorder.html#id1) * [Record Template](https://qlib.readthedocs.io/en/v0.9.5/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/v0.9.5/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.9.5/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.9.5/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.5/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.9.5/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.9.5/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.9.5/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.9.5/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.9.5/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.5/component/online.html#id3) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.5/component/online.html#id7) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.5/component/online.html#id11) * [Updater](https://qlib.readthedocs.io/en/v0.9.5/component/online.html#id12) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.5/component/rl/toctree.html) * [Guidance](https://qlib.readthedocs.io/en/v0.9.5/component/rl/guidance.html) * [Beginners to Reinforcement Learning Algorithms](https://qlib.readthedocs.io/en/v0.9.5/component/rl/guidance.html#beginners-to-reinforcement-learning-algorithms) * [Reinforcement Learning Algorithm Researcher](https://qlib.readthedocs.io/en/v0.9.5/component/rl/guidance.html#reinforcement-learning-algorithm-researcher) * [Quantitative Researcher](https://qlib.readthedocs.io/en/v0.9.5/component/rl/guidance.html#quantitative-researcher) * [Overall](https://qlib.readthedocs.io/en/v0.9.5/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.5/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.5/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.5/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/v0.9.5/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/v0.9.5/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/v0.9.5/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/v0.9.5/component/rl/framework.html#training-vessel-trainer) OTHER COMPONENTS/FEATURES/TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.9.5/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.9.5/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.9.5/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.9.5/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.9.5/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.9.5/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.9.5/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.9.5/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.9.5/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.9.5/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.5/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.9.5/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.9.5/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.9.5/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.9.5/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.9.5/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/v0.9.5/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.5/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.5/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/v0.9.5/advanced/PIT.html#file-based-design-for-pit-data) FOR DEVELOPERS: * [Code Standard](https://qlib.readthedocs.io/en/v0.9.5/developer/code_standard_and_dev_guide.html) * [Docstring](https://qlib.readthedocs.io/en/v0.9.5/developer/code_standard_and_dev_guide.html#docstring) * [Continuous Integration](https://qlib.readthedocs.io/en/v0.9.5/developer/code_standard_and_dev_guide.html#continuous-integration) * [Development Guidance](https://qlib.readthedocs.io/en/v0.9.5/developer/code_standard_and_dev_guide.html#development-guidance) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.contrib.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#id5) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#id10) * [Serializable](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.utils.serial) * [RL](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#rl) * [Base Component](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.rl) * [Strategy](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#id11) * [Trainer](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#id12) * [Order Execution](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#module-qlib.rl.order_execution) * [Utils](https://qlib.readthedocs.io/en/v0.9.5/reference/api.html#id13) * [FAQ](https://qlib.readthedocs.io/en/v0.9.5/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.9.5/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.9.5/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.9.5/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.9.5/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.9.5/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.9.5/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.9.5/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.9.1 documentation * [Docs](https://qlib.readthedocs.io/en/v0.9.1/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.9.1/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.9.1/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.9.1/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.9.1/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.1/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.9.1/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.9.1/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.9.1/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.1/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.9.1/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.9.1/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.9.1/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.9.1/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.9.1/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.1/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.9.1/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.9.1/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.1/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.9.1/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.1/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.9.1/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.9.1/start/integration.html#reference) MAIN COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.9.1/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.9.1/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.1/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.9.1/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.9.1/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.9.1/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#id7) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#id8) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#id9) * [Processor](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#id12) * [Dataset](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#id13) * [API](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#id14) * [Cache](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.9.1/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.9.1/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.1/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.9.1/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.9.1/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.9.1/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.9.1/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.9.1/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.9.1/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.9.1/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.9.1/component/meta.html#meta-task) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.9.1/component/meta.html#meta-dataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.9.1/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.9.1/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.9.1/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.9.1/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.9.1/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.9.1/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.9.1/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.1/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.1/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.1/component/recorder.html#id1) * [Record Template](https://qlib.readthedocs.io/en/v0.9.1/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/v0.9.1/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.9.1/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.9.1/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.1/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.9.1/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.9.1/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.9.1/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.9.1/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.9.1/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.1/component/online.html#id3) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.1/component/online.html#id7) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.1/component/online.html#id11) * [Updater](https://qlib.readthedocs.io/en/v0.9.1/component/online.html#id12) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.1/component/rl/toctree.html) * [Overall](https://qlib.readthedocs.io/en/v0.9.1/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.1/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.1/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.1/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/v0.9.1/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/v0.9.1/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/v0.9.1/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/v0.9.1/component/rl/framework.html#training-vessel-trainer) OTHER COMPONENTS/FEATURES/TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.9.1/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.9.1/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.9.1/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.9.1/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.9.1/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.9.1/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.9.1/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.9.1/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.9.1/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.9.1/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.1/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.9.1/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.9.1/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.9.1/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.9.1/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.9.1/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/v0.9.1/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.1/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.1/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/v0.9.1/advanced/PIT.html#file-based-design-for-pit-data) FOR DEVELOPERS: * [Code Standard](https://qlib.readthedocs.io/en/v0.9.1/developer/code_standard_and_dev_guide.html) * [Docstring](https://qlib.readthedocs.io/en/v0.9.1/developer/code_standard_and_dev_guide.html#docstring) * [Continuous Integration](https://qlib.readthedocs.io/en/v0.9.1/developer/code_standard_and_dev_guide.html#continuous-integration) * [Development Guidance](https://qlib.readthedocs.io/en/v0.9.1/developer/code_standard_and_dev_guide.html#development-guidance) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.contrib.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#id5) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#id10) * [Serializable](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.utils.serial) * [RL](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#rl) * [Base Component](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.rl) * [Strategy](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#id11) * [Trainer](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#id12) * [Order Execution](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#module-qlib.rl.order_execution) * [Utils](https://qlib.readthedocs.io/en/v0.9.1/reference/api.html#id13) * [FAQ](https://qlib.readthedocs.io/en/v0.9.1/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.9.1/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.9.1/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.9.1/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.9.1/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.9.1/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.9.1/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.9.1/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.9.0 documentation * [Docs](https://qlib.readthedocs.io/en/v0.9.0/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.9.0/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.9.0/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.9.0/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.9.0/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.0/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.9.0/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.9.0/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.9.0/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.0/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.9.0/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.9.0/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.9.0/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.9.0/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.9.0/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.0/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.9.0/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.9.0/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.0/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.9.0/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.0/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.9.0/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.9.0/start/integration.html#reference) MAIN COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.9.0/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.9.0/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.0/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.9.0/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.9.0/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.9.0/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#id7) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#id8) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#id9) * [Processor](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#id12) * [Dataset](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#id13) * [API](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#id14) * [Cache](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.9.0/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.9.0/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.0/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.9.0/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.9.0/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.9.0/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.9.0/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.9.0/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.9.0/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.9.0/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.9.0/component/meta.html#meta-task) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.9.0/component/meta.html#meta-dataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.9.0/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.9.0/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.9.0/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.9.0/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.9.0/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.9.0/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.9.0/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.0/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.0/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.0/component/recorder.html#id1) * [Record Template](https://qlib.readthedocs.io/en/v0.9.0/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/v0.9.0/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.9.0/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.9.0/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.0/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.9.0/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.9.0/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.9.0/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.9.0/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.9.0/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.0/component/online.html#id3) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.0/component/online.html#id7) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.0/component/online.html#id11) * [Updater](https://qlib.readthedocs.io/en/v0.9.0/component/online.html#id12) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.0/component/rl/toctree.html) * [Overall](https://qlib.readthedocs.io/en/v0.9.0/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.0/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.0/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.0/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/v0.9.0/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/v0.9.0/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/v0.9.0/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/v0.9.0/component/rl/framework.html#training-vessel-trainer) OTHER COMPONENTS/FEATURES/TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.9.0/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.9.0/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.9.0/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.9.0/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.9.0/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.9.0/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.9.0/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.9.0/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.9.0/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.9.0/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.0/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.9.0/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.9.0/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.9.0/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.9.0/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.9.0/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/v0.9.0/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.0/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.0/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/v0.9.0/advanced/PIT.html#file-based-design-for-pit-data) FOR DEVELOPERS: * [Code Standard](https://qlib.readthedocs.io/en/v0.9.0/developer/code_standard_and_dev_guide.html) * [Docstring](https://qlib.readthedocs.io/en/v0.9.0/developer/code_standard_and_dev_guide.html#docstring) * [Continuous Integration](https://qlib.readthedocs.io/en/v0.9.0/developer/code_standard_and_dev_guide.html#continuous-integration) * [Development Guidance](https://qlib.readthedocs.io/en/v0.9.0/developer/code_standard_and_dev_guide.html#development-guidance) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.contrib.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#id5) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#id10) * [Serializable](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.utils.serial) * [RL](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#rl) * [Base Component](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.rl) * [Strategy](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#id11) * [Trainer](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#id12) * [Order Execution](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#module-qlib.rl.order_execution) * [Utils](https://qlib.readthedocs.io/en/v0.9.0/reference/api.html#id13) * [FAQ](https://qlib.readthedocs.io/en/v0.9.0/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.9.0/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.9.0/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.9.0/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.9.0/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.9.0/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.9.0/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.9.0/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.8.6 documentation * [Docs](https://qlib.readthedocs.io/en/v0.8.6/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.8.6/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.8.6/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.8.6/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.8.6/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.8.6/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.8.6/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.8.6/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.8.6/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.6/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.8.6/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.8.6/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.8.6/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.8.6/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.8.6/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.6/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.8.6/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.8.6/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.6/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.8.6/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.6/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.8.6/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.8.6/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.8.6/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.8.6/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.6/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.8.6/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.8.6/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.8.6/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#id9) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#id10) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#id11) * [Processor](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#id14) * [Dataset](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#id15) * [API](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#id16) * [Cache](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.8.6/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.8.6/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.6/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.8.6/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.8.6/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.8.6/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.8.6/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.8.6/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.8.6/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.8.6/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.8.6/component/meta.html#meta-task) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.8.6/component/meta.html#meta-dataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.8.6/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.8.6/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.8.6/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.8.6/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.8.6/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.8.6/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.8.6/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.6/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.6/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.6/component/recorder.html#id4) * [Record Template](https://qlib.readthedocs.io/en/v0.8.6/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/v0.8.6/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.8.6/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.8.6/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.6/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.8.6/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.8.6/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.8.6/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.8.6/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.8.6/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.6/component/online.html#id2) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.6/component/online.html#id6) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.6/component/online.html#id10) * [Updater](https://qlib.readthedocs.io/en/v0.8.6/component/online.html#id11) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.8.6/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.8.6/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.8.6/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.8.6/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.8.6/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.8.6/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.8.6/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.8.6/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.8.6/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.8.6/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.6/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.8.6/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.8.6/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.8.6/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.8.6/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.8.6/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/v0.8.6/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.6/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.8.6/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/v0.8.6/advanced/PIT.html#file-based-design-for-pit-data) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#id21) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#id26) * [Serializable](https://qlib.readthedocs.io/en/v0.8.6/reference/api.html#module-qlib.utils.serial.Serializable) * [FAQ](https://qlib.readthedocs.io/en/v0.8.6/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.8.6/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.8.6/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.8.6/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.8.6/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.8.6/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.8.6/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.8.6/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.8.4.99 documentation * [Docs](https://qlib.readthedocs.io/en/v0.8.5/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.8.5/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.8.5/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.8.5/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.8.5/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.8.5/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.8.5/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.8.5/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.8.5/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.5/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.8.5/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.8.5/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.8.5/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.8.5/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.8.5/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.5/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.8.5/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.8.5/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.5/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.8.5/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.5/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.8.5/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.8.5/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.8.5/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.8.5/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.5/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.8.5/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.8.5/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.8.5/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#id9) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#id10) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#id11) * [Processor](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#id14) * [Dataset](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#id15) * [API](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#id16) * [Cache](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.8.5/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.8.5/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.5/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.8.5/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.8.5/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.8.5/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.8.5/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.8.5/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.8.5/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.8.5/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.8.5/component/meta.html#meta-task) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.8.5/component/meta.html#meta-dataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.8.5/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.8.5/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.8.5/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.8.5/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.8.5/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.8.5/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.8.5/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.5/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.5/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.5/component/recorder.html#id4) * [Record Template](https://qlib.readthedocs.io/en/v0.8.5/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/v0.8.5/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.8.5/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.8.5/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.5/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.8.5/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.8.5/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.8.5/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.8.5/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.8.5/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.5/component/online.html#id2) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.5/component/online.html#id6) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.5/component/online.html#id10) * [Updater](https://qlib.readthedocs.io/en/v0.8.5/component/online.html#id11) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.8.5/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.8.5/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.8.5/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.8.5/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.8.5/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.8.5/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.8.5/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.8.5/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.8.5/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.8.5/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.5/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.8.5/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.8.5/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.8.5/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.8.5/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.8.5/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/v0.8.5/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.5/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.8.5/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/v0.8.5/advanced/PIT.html#file-based-design-for-pit-data) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#id21) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#id26) * [Serializable](https://qlib.readthedocs.io/en/v0.8.5/reference/api.html#module-qlib.utils.serial.Serializable) * [FAQ](https://qlib.readthedocs.io/en/v0.8.5/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.8.5/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.8.5/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.8.5/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.8.5/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.8.5/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.8.5/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.8.5/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.8.3 documentation * [Docs](https://qlib.readthedocs.io/en/v0.8.3/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.8.3/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.8.3/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.8.3/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.8.3/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.8.3/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.8.3/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.8.3/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.8.3/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.3/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.8.3/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.8.3/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.8.3/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.8.3/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.8.3/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.3/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.8.3/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.8.3/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.3/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.8.3/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.3/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.8.3/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.8.3/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.8.3/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.8.3/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.3/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.8.3/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.8.3/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.8.3/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#id9) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#id10) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#id11) * [Processor](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#id14) * [Dataset](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#id15) * [API](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#id16) * [Cache](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.8.3/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.8.3/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.3/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.8.3/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.8.3/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.8.3/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.8.3/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.8.3/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.8.3/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.8.3/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.8.3/component/meta.html#meta-task) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.8.3/component/meta.html#meta-dataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.8.3/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.8.3/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.8.3/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.8.3/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.8.3/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.8.3/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.8.3/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.3/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.3/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.3/component/recorder.html#id4) * [Record Template](https://qlib.readthedocs.io/en/v0.8.3/component/recorder.html#record-template) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.8.3/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.8.3/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.3/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.8.3/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.8.3/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.8.3/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.8.3/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.8.3/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.3/component/online.html#id2) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.3/component/online.html#id6) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.3/component/online.html#id10) * [Updater](https://qlib.readthedocs.io/en/v0.8.3/component/online.html#id11) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.8.3/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.8.3/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.8.3/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.8.3/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.8.3/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.8.3/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.8.3/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.8.3/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.8.3/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.8.3/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.3/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.8.3/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.3/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.8.3/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.8.3/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.8.3/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.8.3/advanced/task_management.html#task-collecting) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#id21) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#id26) * [Serializable](https://qlib.readthedocs.io/en/v0.8.3/reference/api.html#module-qlib.utils.serial.Serializable) * [FAQ](https://qlib.readthedocs.io/en/v0.8.3/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.8.3/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.8.3/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.8.3/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.8.3/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.8.3/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.8.3/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.8.3/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.6.2 documentation * [Docs](https://qlib.readthedocs.io/en/v0.6.3/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.6.3/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.6.3/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.6.3/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.6.3/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.6.3/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.6.3/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.6.3/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.6.3/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.6.3/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.6.3/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.6.3/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.6.3/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.6.3/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.6.3/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.6.3/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.6.3/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.6.3/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.6.3/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.6.3/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.6.3/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.6.3/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.6.3/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.6.3/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.6.3/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.6.3/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.6.3/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.6.3/component/workflow.html#task-section) * [Data Layer: Data Framework&Usage](https://qlib.readthedocs.io/en/v0.6.3/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#qlib-format-dataset) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#converting-csv-format-into-qlib-format) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#data-loader) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#data-handler) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#id6) * [Processor](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#id9) * [Dataset](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#dataset) * [API](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#id10) * [Cache](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.6.3/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.6.3/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.6.3/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.6.3/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.6.3/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.6.3/component/model.html#api) * [Strategy: Portfolio Management](https://qlib.readthedocs.io/en/v0.6.3/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.6.3/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.6.3/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.6.3/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.6.3/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.6.3/component/strategy.html#topkdropoutstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.6.3/component/strategy.html#usage-example) * [Reference](https://qlib.readthedocs.io/en/v0.6.3/component/strategy.html#reference) * [Intraday Trading: Model&Strategy Testing](https://qlib.readthedocs.io/en/v0.6.3/component/backtest.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/component/backtest.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.6.3/component/backtest.html#example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.6.3/component/backtest.html#prediction-score) * [Backtest Result](https://qlib.readthedocs.io/en/v0.6.3/component/backtest.html#backtest-result) * [Reference](https://qlib.readthedocs.io/en/v0.6.3/component/backtest.html#reference) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.6.3/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.6.3/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.6.3/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.6.3/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.6.3/component/recorder.html#id4) * [Record Template](https://qlib.readthedocs.io/en/v0.6.3/component/recorder.html#record-template) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.6.3/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.6.3/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.6.3/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.6.3/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.6.3/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.6.3/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.6.3/component/report.html#usage-of-analysis-model-analysis-model-performance) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.6.3/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.6.3/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.6.3/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.6.3/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.6.3/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.3/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.6.3/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.6.3/advanced/server.html#reference) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#cache) * [Dataset](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#module-qlib.contrib.strategy.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.6.3/reference/api.html#module-qlib.workflow.record_temp) * [FAQ](https://qlib.readthedocs.io/en/v0.6.3/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.6.3/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.6.3/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.6.3/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-0-5-0) * [Version greater than Version 0.5.0](https://qlib.readthedocs.io/en/v0.6.3/changelog/changelog.html#version-greater-than-version-0-5-0) --- # Qlib Documentation — QLib 0.6.2 documentation * [Docs](https://qlib.readthedocs.io/en/v0.6.2/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.6.2/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.6.2/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.6.2/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.6.2/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.6.2/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.6.2/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.6.2/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.6.2/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.6.2/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.6.2/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.6.2/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.6.2/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.6.2/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.6.2/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.6.2/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.6.2/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.6.2/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.6.2/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.6.2/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.6.2/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.6.2/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.6.2/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.6.2/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.6.2/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.6.2/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.6.2/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.6.2/component/workflow.html#task-section) * [Data Layer: Data Framework&Usage](https://qlib.readthedocs.io/en/v0.6.2/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#qlib-format-dataset) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#converting-csv-format-into-qlib-format) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#data-loader) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#data-handler) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#id6) * [Processor](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#id9) * [Dataset](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#dataset) * [API](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#id10) * [Cache](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.6.2/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.6.2/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.6.2/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.6.2/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.6.2/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.6.2/component/model.html#api) * [Strategy: Portfolio Management](https://qlib.readthedocs.io/en/v0.6.2/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.6.2/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.6.2/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.6.2/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.6.2/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.6.2/component/strategy.html#topkdropoutstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.6.2/component/strategy.html#usage-example) * [Reference](https://qlib.readthedocs.io/en/v0.6.2/component/strategy.html#reference) * [Intraday Trading: Model&Strategy Testing](https://qlib.readthedocs.io/en/v0.6.2/component/backtest.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/component/backtest.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.6.2/component/backtest.html#example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.6.2/component/backtest.html#prediction-score) * [Backtest Result](https://qlib.readthedocs.io/en/v0.6.2/component/backtest.html#backtest-result) * [Reference](https://qlib.readthedocs.io/en/v0.6.2/component/backtest.html#reference) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.6.2/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.6.2/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.6.2/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.6.2/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.6.2/component/recorder.html#id4) * [Record Template](https://qlib.readthedocs.io/en/v0.6.2/component/recorder.html#record-template) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.6.2/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.6.2/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.6.2/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.6.2/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.6.2/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.6.2/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.6.2/component/report.html#usage-of-analysis-model-analysis-model-performance) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.6.2/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.6.2/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.6.2/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.6.2/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.6.2/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.2/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.6.2/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.6.2/advanced/server.html#reference) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#cache) * [Dataset](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#module-qlib.contrib.strategy.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.6.2/reference/api.html#module-qlib.workflow.record_temp) * [FAQ](https://qlib.readthedocs.io/en/v0.6.2/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.6.2/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.6.2/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.6.2/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-0-5-0) * [Version greater than Version 0.5.0](https://qlib.readthedocs.io/en/v0.6.2/changelog/changelog.html#version-greater-than-version-0-5-0) --- # Qlib Documentation — QLib 0.7.2 documentation * [Docs](https://qlib.readthedocs.io/en/v0.7.2/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.7.2/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.7.2/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.7.2/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.7.2/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.7.2/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.7.2/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.7.2/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.7.2/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.7.2/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.7.2/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.7.2/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.7.2/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.7.2/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.7.2/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.7.2/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.7.2/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.7.2/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.7.2/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.7.2/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.7.2/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.7.2/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.7.2/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.7.2/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.7.2/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.7.2/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.7.2/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.7.2/component/workflow.html#task-section) * [Data Layer: Data Framework&Usage](https://qlib.readthedocs.io/en/v0.7.2/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#data-loader) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#data-handler) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#id7) * [Processor](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#id10) * [Dataset](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#dataset) * [API](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#id11) * [Cache](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.7.2/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.7.2/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.7.2/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.7.2/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.7.2/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.7.2/component/model.html#api) * [Strategy: Portfolio Management](https://qlib.readthedocs.io/en/v0.7.2/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.7.2/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.7.2/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.7.2/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.7.2/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.7.2/component/strategy.html#topkdropoutstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.7.2/component/strategy.html#usage-example) * [Reference](https://qlib.readthedocs.io/en/v0.7.2/component/strategy.html#reference) * [Intraday Trading: Model&Strategy Testing](https://qlib.readthedocs.io/en/v0.7.2/component/backtest.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/component/backtest.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.7.2/component/backtest.html#example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.7.2/component/backtest.html#prediction-score) * [Backtest Result](https://qlib.readthedocs.io/en/v0.7.2/component/backtest.html#backtest-result) * [Reference](https://qlib.readthedocs.io/en/v0.7.2/component/backtest.html#reference) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.7.2/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.7.2/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.7.2/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.7.2/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.7.2/component/recorder.html#id4) * [Record Template](https://qlib.readthedocs.io/en/v0.7.2/component/recorder.html#record-template) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.7.2/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.7.2/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.7.2/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.7.2/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.7.2/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.7.2/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.7.2/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.7.2/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.7.2/component/online.html#id2) * [Online Strategy](https://qlib.readthedocs.io/en/v0.7.2/component/online.html#id6) * [Online Tool](https://qlib.readthedocs.io/en/v0.7.2/component/online.html#id10) * [Updater](https://qlib.readthedocs.io/en/v0.7.2/component/online.html#id11) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.7.2/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.7.2/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.7.2/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.7.2/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.7.2/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.7.2/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.7.2/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.7.2/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.7.2/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.7.2/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.7.2/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.7.2/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.7.2/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.7.2/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.7.2/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.7.2/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.7.2/advanced/task_management.html#task-collecting) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.contrib.strategy.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#id21) * [Online Tool](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#id26) * [Serializable](https://qlib.readthedocs.io/en/v0.7.2/reference/api.html#module-qlib.utils.serial.Serializable) * [FAQ](https://qlib.readthedocs.io/en/v0.7.2/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.7.2/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.7.2/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.7.2/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.7.2/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.7.2/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.7.2/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-0-5-0) * [Version greater than Version 0.5.0](https://qlib.readthedocs.io/en/v0.7.2/changelog/changelog.html#version-greater-than-version-0-5-0) --- # Qlib Documentation — QLib 0.9.3 documentation * [Docs](https://qlib.readthedocs.io/en/v0.9.3/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.9.3/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.9.3/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.9.3/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.9.3/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.3/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.9.3/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.9.3/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.9.3/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.3/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.9.3/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.9.3/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.9.3/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.9.3/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.9.3/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.3/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.9.3/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.9.3/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.9.3/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.9.3/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.3/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.9.3/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.9.3/start/integration.html#reference) MAIN COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.9.3/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.9.3/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.9.3/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.9.3/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.9.3/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.9.3/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#id7) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#id8) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#id9) * [Processor](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#id12) * [Dataset](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#id13) * [API](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#id14) * [Cache](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.9.3/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.9.3/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.3/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.9.3/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.9.3/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.9.3/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.9.3/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.9.3/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.9.3/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.9.3/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.9.3/component/meta.html#meta-task) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.9.3/component/meta.html#meta-dataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.9.3/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.9.3/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.9.3/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.9.3/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.9.3/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.9.3/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.9.3/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.3/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.3/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.3/component/recorder.html#id1) * [Record Template](https://qlib.readthedocs.io/en/v0.9.3/component/recorder.html#record-template) * [Known Limitations](https://qlib.readthedocs.io/en/v0.9.3/component/recorder.html#known-limitations) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.9.3/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.9.3/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.9.3/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.9.3/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.9.3/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.9.3/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.9.3/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.9.3/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.3/component/online.html#id3) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.3/component/online.html#id7) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.3/component/online.html#id11) * [Updater](https://qlib.readthedocs.io/en/v0.9.3/component/online.html#id12) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.3/component/rl/toctree.html) * [Guidance](https://qlib.readthedocs.io/en/v0.9.3/component/rl/guidance.html) * [Beginners to Reinforcement Learning Algorithms](https://qlib.readthedocs.io/en/v0.9.3/component/rl/guidance.html#beginners-to-reinforcement-learning-algorithms) * [Reinforcement Learning Algorithm Researcher](https://qlib.readthedocs.io/en/v0.9.3/component/rl/guidance.html#reinforcement-learning-algorithm-researcher) * [Quantitative Researcher](https://qlib.readthedocs.io/en/v0.9.3/component/rl/guidance.html#quantitative-researcher) * [Overall](https://qlib.readthedocs.io/en/v0.9.3/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.3/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.3/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.3/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/v0.9.3/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/v0.9.3/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/v0.9.3/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/v0.9.3/component/rl/framework.html#training-vessel-trainer) OTHER COMPONENTS/FEATURES/TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.9.3/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.9.3/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.9.3/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.9.3/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.9.3/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.9.3/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.9.3/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.9.3/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.9.3/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.9.3/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.9.3/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.9.3/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.9.3/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.9.3/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.9.3/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.9.3/advanced/task_management.html#task-collecting) * [Point-In-Time database](https://qlib.readthedocs.io/en/v0.9.3/advanced/PIT.html) * [Introduction](https://qlib.readthedocs.io/en/v0.9.3/advanced/PIT.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.9.3/advanced/PIT.html#data-preparation) * [File-based design for PIT data](https://qlib.readthedocs.io/en/v0.9.3/advanced/PIT.html#file-based-design-for-pit-data) FOR DEVELOPERS: * [Code Standard](https://qlib.readthedocs.io/en/v0.9.3/developer/code_standard_and_dev_guide.html) * [Docstring](https://qlib.readthedocs.io/en/v0.9.3/developer/code_standard_and_dev_guide.html#docstring) * [Continuous Integration](https://qlib.readthedocs.io/en/v0.9.3/developer/code_standard_and_dev_guide.html#continuous-integration) * [Development Guidance](https://qlib.readthedocs.io/en/v0.9.3/developer/code_standard_and_dev_guide.html#development-guidance) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.contrib.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#id5) * [Online Tool](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#id10) * [Serializable](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.utils.serial) * [RL](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#rl) * [Base Component](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.rl) * [Strategy](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#id11) * [Trainer](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#id12) * [Order Execution](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#module-qlib.rl.order_execution) * [Utils](https://qlib.readthedocs.io/en/v0.9.3/reference/api.html#id13) * [FAQ](https://qlib.readthedocs.io/en/v0.9.3/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.9.3/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.9.3/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.9.3/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.9.3/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.9.3/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.9.3/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.9.3/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.8.0.99 documentation * [Docs](https://qlib.readthedocs.io/en/v0.8.1/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.8.1/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.8.1/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.8.1/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.8.1/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.8.1/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.8.1/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.8.1/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.8.1/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.1/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.8.1/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.8.1/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.8.1/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.8.1/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.8.1/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.1/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.8.1/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.8.1/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.1/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.8.1/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.1/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.8.1/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.8.1/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.8.1/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.8.1/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.1/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.8.1/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.8.1/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.8.1/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#id9) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#id10) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#id11) * [Processor](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#id14) * [Dataset](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#id15) * [API](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#id16) * [Cache](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.8.1/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.8.1/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.1/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.8.1/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.8.1/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.8.1/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.8.1/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.8.1/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.8.1/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.8.1/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.8.1/component/meta.html#meta-task) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.8.1/component/meta.html#meta-dataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.8.1/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.8.1/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.8.1/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.8.1/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.8.1/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.8.1/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.8.1/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.1/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.1/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.1/component/recorder.html#id4) * [Record Template](https://qlib.readthedocs.io/en/v0.8.1/component/recorder.html#record-template) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.8.1/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.8.1/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.1/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.8.1/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.8.1/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.8.1/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.8.1/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.8.1/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.1/component/online.html#id2) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.1/component/online.html#id6) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.1/component/online.html#id10) * [Updater](https://qlib.readthedocs.io/en/v0.8.1/component/online.html#id11) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.8.1/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.8.1/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.8.1/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.8.1/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.8.1/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.8.1/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.8.1/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.8.1/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.8.1/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.8.1/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.1/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.8.1/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.1/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.8.1/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.8.1/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.8.1/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.8.1/advanced/task_management.html#task-collecting) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#id21) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#id26) * [Serializable](https://qlib.readthedocs.io/en/v0.8.1/reference/api.html#module-qlib.utils.serial.Serializable) * [FAQ](https://qlib.readthedocs.io/en/v0.8.1/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.8.1/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.8.1/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.8.1/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.8.1/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.8.1/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.8.1/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.8.1/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.4.6.dev0 documentation * [Docs](https://qlib.readthedocs.io/en/v0.5.0/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.5.0/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.5.0/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.5.0/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.5.0/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.5.0/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.5.0/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.5.0/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.5.0/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.5.0/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.5.0/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.5.0/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.5.0/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.5.0/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.5.0/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.5.0/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.5.0/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.5.0/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.5.0/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.5.0/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.5.0/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.5.0/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.5.0/start/integration.html#reference) COMPONENTS: * [Estimator: Workflow Management](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#configuration-file) * [Experiment Section](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#experiment-section) * [Model Section](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#model-section) * [Data Section](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#data-section) * [Trainer Section](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#trainer-section) * [Strategy Section](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#strategy-section) * [Backtest Section](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#backtest-section) * [Qlib Data Section](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#qlib-data-section) * [Experiment Result](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#experiment-result) * [Form of Experimental Result](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#form-of-experimental-result) * [Get Experiment Result](https://qlib.readthedocs.io/en/v0.5.0/component/estimator.html#get-experiment-result) * [Data Layer: Data Framework&Usage](https://qlib.readthedocs.io/en/v0.5.0/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#qlib-format-dataset) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#converting-csv-format-into-qlib-format) * [China-Stock Mode & US-Stock Mode](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#china-stock-mode-us-stock-mode) * [Data API](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#filter) * [API](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#data-handler) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#base-class-interface) * [Usage](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#usage) * [Example](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#id8) * [Cache](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.5.0/component/data.html#data-and-cache-file-structure) * [Interday Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.5.0/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.5.0/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.5.0/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.5.0/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.5.0/component/model.html#api) * [Interday Strategy: Portfolio Management](https://qlib.readthedocs.io/en/v0.5.0/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.5.0/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.5.0/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.5.0/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.5.0/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.5.0/component/strategy.html#topkdropoutstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.5.0/component/strategy.html#usage-example) * [Reference](https://qlib.readthedocs.io/en/v0.5.0/component/strategy.html#reference) * [Intraday Trading: Model&Strategy Testing](https://qlib.readthedocs.io/en/v0.5.0/component/backtest.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/component/backtest.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.5.0/component/backtest.html#example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.5.0/component/backtest.html#prediction-score) * [Backtest Result](https://qlib.readthedocs.io/en/v0.5.0/component/backtest.html#backtest-result) * [Reference](https://qlib.readthedocs.io/en/v0.5.0/component/backtest.html#reference) * [Aanalysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.5.0/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.5.0/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.5.0/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.5.0/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.5.0/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.cumulative\_return](https://qlib.readthedocs.io/en/v0.5.0/component/report.html#usage-of-analysis-position-cumulative-return) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.5.0/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_position.rank\_label](https://qlib.readthedocs.io/en/v0.5.0/component/report.html#usage-of-analysis-position-rank-label) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.5.0/component/report.html#usage-of-analysis-model-analysis-model-performance) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.5.0/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.5.0/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.5.0/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.5.0/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.5.0/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.0/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.5.0/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.5.0/advanced/server.html#reference) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#module-qlib.data.filter) * [Feature](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#feature) * [Cache](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#cache) * [Contrib](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#contrib) * [Data Handler](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#module-qlib.contrib.estimator.handler) * [Model](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#module-qlib.contrib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#module-qlib.contrib.strategy.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.5.0/reference/api.html#module-qlib.contrib.report.analysis_position.report) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.5.0/changelog/changelog.html#version-0-4-6) --- # Qlib Documentation — QLib 0.6.0 documentation * [Docs](https://qlib.readthedocs.io/en/v0.6.0/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.6.0/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.6.0/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.6.0/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.6.0/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.6.0/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.6.0/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.6.0/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.6.0/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.6.0/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.6.0/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.6.0/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.6.0/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.6.0/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.6.0/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.6.0/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.6.0/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.6.0/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.6.0/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.6.0/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.6.0/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.6.0/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.6.0/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.6.0/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.6.0/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.6.0/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.6.0/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.6.0/component/workflow.html#task-section) * [Data Layer: Data Framework&Usage](https://qlib.readthedocs.io/en/v0.6.0/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#qlib-format-dataset) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#converting-csv-format-into-qlib-format) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#data-loader) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#data-handler) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#id6) * [Processor](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#id9) * [Dataset](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#dataset) * [API](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#id10) * [Cache](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.6.0/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.6.0/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.6.0/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.6.0/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.6.0/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.6.0/component/model.html#api) * [Strategy: Portfolio Management](https://qlib.readthedocs.io/en/v0.6.0/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.6.0/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.6.0/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.6.0/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.6.0/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.6.0/component/strategy.html#topkdropoutstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.6.0/component/strategy.html#usage-example) * [Reference](https://qlib.readthedocs.io/en/v0.6.0/component/strategy.html#reference) * [Intraday Trading: Model&Strategy Testing](https://qlib.readthedocs.io/en/v0.6.0/component/backtest.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/component/backtest.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.6.0/component/backtest.html#example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.6.0/component/backtest.html#prediction-score) * [Backtest Result](https://qlib.readthedocs.io/en/v0.6.0/component/backtest.html#backtest-result) * [Reference](https://qlib.readthedocs.io/en/v0.6.0/component/backtest.html#reference) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.6.0/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.6.0/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.6.0/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.6.0/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.6.0/component/recorder.html#id3) * [Record Template](https://qlib.readthedocs.io/en/v0.6.0/component/recorder.html#record-template) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.6.0/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.6.0/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.6.0/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.6.0/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.6.0/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.6.0/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.6.0/component/report.html#usage-of-analysis-model-analysis-model-performance) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.6.0/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.6.0/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.6.0/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.6.0/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.6.0/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.0/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.6.0/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.6.0/advanced/server.html#reference) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#cache) * [Dataset](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#module-qlib.contrib.strategy.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.6.0/reference/api.html#module-qlib.workflow.record_temp) * [FAQ](https://qlib.readthedocs.io/en/v0.6.0/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.6.0/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.6.0/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.6.0/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-0-5-0) * [Version greater than Version 0.5.0](https://qlib.readthedocs.io/en/v0.6.0/changelog/changelog.html#version-greater-than-version-0-5-0) --- # Qlib Documentation — QLib 0.5.1 documentation * [Docs](https://qlib.readthedocs.io/en/v0.5.1/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.5.1/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.5.1/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.5.1/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.5.1/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.5.1/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.5.1/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.5.1/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.5.1/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.5.1/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.5.1/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.5.1/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.5.1/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.5.1/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.5.1/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.5.1/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.5.1/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.5.1/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.5.1/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.5.1/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.5.1/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.5.1/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.5.1/start/integration.html#reference) COMPONENTS: * [Estimator: Workflow Management](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#configuration-file) * [Experiment Section](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#experiment-section) * [Model Section](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#model-section) * [Data Section](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#data-section) * [Trainer Section](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#trainer-section) * [Strategy Section](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#strategy-section) * [Backtest Section](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#backtest-section) * [Qlib Data Section](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#qlib-data-section) * [Experiment Result](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#experiment-result) * [Form of Experimental Result](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#form-of-experimental-result) * [Get Experiment Result](https://qlib.readthedocs.io/en/v0.5.1/component/estimator.html#get-experiment-result) * [Data Layer: Data Framework&Usage](https://qlib.readthedocs.io/en/v0.5.1/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#qlib-format-dataset) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#converting-csv-format-into-qlib-format) * [China-Stock Mode & US-Stock Mode](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#china-stock-mode-us-stock-mode) * [Data API](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#reference) * [Data Handler](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#data-handler) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#base-class-interface) * [Usage](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#usage) * [Example](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#api) * [Cache](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.5.1/component/data.html#data-and-cache-file-structure) * [Interday Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.5.1/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.5.1/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.5.1/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.5.1/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.5.1/component/model.html#api) * [Interday Strategy: Portfolio Management](https://qlib.readthedocs.io/en/v0.5.1/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.5.1/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.5.1/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.5.1/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.5.1/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.5.1/component/strategy.html#topkdropoutstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.5.1/component/strategy.html#usage-example) * [Reference](https://qlib.readthedocs.io/en/v0.5.1/component/strategy.html#reference) * [Intraday Trading: Model&Strategy Testing](https://qlib.readthedocs.io/en/v0.5.1/component/backtest.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/component/backtest.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.5.1/component/backtest.html#example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.5.1/component/backtest.html#prediction-score) * [Backtest Result](https://qlib.readthedocs.io/en/v0.5.1/component/backtest.html#backtest-result) * [Reference](https://qlib.readthedocs.io/en/v0.5.1/component/backtest.html#reference) * [Aanalysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.5.1/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.5.1/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.5.1/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.5.1/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.5.1/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.5.1/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.5.1/component/report.html#usage-of-analysis-model-analysis-model-performance) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.5.1/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.5.1/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.5.1/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.5.1/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.5.1/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.5.1/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.5.1/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.5.1/advanced/server.html#reference) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#module-qlib.data.filter) * [Feature](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#feature) * [Cache](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#cache) * [Contrib](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#contrib) * [Data Handler](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#module-qlib.contrib.estimator.handler) * [Model](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#module-qlib.contrib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#module-qlib.contrib.strategy.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.5.1/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [FAQ](https://qlib.readthedocs.io/en/v0.5.1/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.5.1/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.5.1/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.5.1/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-0-5-0) * [Version greater than Version 0.5.0](https://qlib.readthedocs.io/en/v0.5.1/changelog/changelog.html#version-greater-than-version-0-5-0) --- # Qlib Documentation — QLib 0.6.1 documentation * [Docs](https://qlib.readthedocs.io/en/v0.6.1/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.6.1/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.6.1/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.6.1/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.6.1/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.6.1/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.6.1/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.6.1/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.6.1/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.6.1/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.6.1/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.6.1/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.6.1/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.6.1/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.6.1/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.6.1/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.6.1/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.6.1/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.6.1/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.6.1/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.6.1/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.6.1/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.6.1/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.6.1/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.6.1/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.6.1/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.6.1/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.6.1/component/workflow.html#task-section) * [Data Layer: Data Framework&Usage](https://qlib.readthedocs.io/en/v0.6.1/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#qlib-format-dataset) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#converting-csv-format-into-qlib-format) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#data-loader) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#data-handler) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#id6) * [Processor](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#id9) * [Dataset](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#dataset) * [API](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#id10) * [Cache](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.6.1/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.6.1/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.6.1/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.6.1/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.6.1/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.6.1/component/model.html#api) * [Strategy: Portfolio Management](https://qlib.readthedocs.io/en/v0.6.1/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.6.1/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.6.1/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.6.1/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.6.1/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.6.1/component/strategy.html#topkdropoutstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.6.1/component/strategy.html#usage-example) * [Reference](https://qlib.readthedocs.io/en/v0.6.1/component/strategy.html#reference) * [Intraday Trading: Model&Strategy Testing](https://qlib.readthedocs.io/en/v0.6.1/component/backtest.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/component/backtest.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.6.1/component/backtest.html#example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.6.1/component/backtest.html#prediction-score) * [Backtest Result](https://qlib.readthedocs.io/en/v0.6.1/component/backtest.html#backtest-result) * [Reference](https://qlib.readthedocs.io/en/v0.6.1/component/backtest.html#reference) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.6.1/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.6.1/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.6.1/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.6.1/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.6.1/component/recorder.html#id3) * [Record Template](https://qlib.readthedocs.io/en/v0.6.1/component/recorder.html#record-template) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.6.1/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.6.1/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.6.1/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.6.1/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.6.1/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.6.1/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.6.1/component/report.html#usage-of-analysis-model-analysis-model-performance) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.6.1/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.6.1/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.6.1/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.6.1/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.6.1/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.6.1/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.6.1/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.6.1/advanced/server.html#reference) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#cache) * [Dataset](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#module-qlib.contrib.strategy.strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.6.1/reference/api.html#module-qlib.workflow.record_temp) * [FAQ](https://qlib.readthedocs.io/en/v0.6.1/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.6.1/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.6.1/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.6.1/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-0-5-0) * [Version greater than Version 0.5.0](https://qlib.readthedocs.io/en/v0.6.1/changelog/changelog.html#version-greater-than-version-0-5-0) --- # Qlib Documentation — QLib 0.8.4 documentation * [Docs](https://qlib.readthedocs.io/en/v0.8.4/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.8.4/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.8.4/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.8.4/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.8.4/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.8.4/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.8.4/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.8.4/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.8.4/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.4/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.8.4/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.8.4/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.8.4/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.8.4/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.8.4/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.4/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.8.4/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.8.4/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.4/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.8.4/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.4/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.8.4/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.8.4/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.8.4/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.8.4/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.4/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.8.4/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.8.4/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.8.4/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#id9) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#id10) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#id11) * [Processor](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#id14) * [Dataset](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#id15) * [API](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#id16) * [Cache](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.8.4/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.8.4/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.4/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.8.4/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.8.4/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.8.4/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.8.4/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.8.4/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.8.4/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.8.4/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.8.4/component/meta.html#meta-task) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.8.4/component/meta.html#meta-dataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.8.4/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.8.4/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.8.4/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.8.4/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.8.4/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.8.4/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.8.4/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.4/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.4/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.4/component/recorder.html#id4) * [Record Template](https://qlib.readthedocs.io/en/v0.8.4/component/recorder.html#record-template) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.8.4/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.8.4/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.4/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.8.4/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.8.4/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.8.4/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.8.4/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.8.4/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.4/component/online.html#id2) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.4/component/online.html#id6) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.4/component/online.html#id10) * [Updater](https://qlib.readthedocs.io/en/v0.8.4/component/online.html#id11) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.8.4/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.8.4/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.8.4/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.8.4/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.8.4/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.8.4/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.8.4/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.8.4/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.8.4/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.8.4/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.4/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.8.4/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.4/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.8.4/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.8.4/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.8.4/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.8.4/advanced/task_management.html#task-collecting) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#id21) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#id26) * [Serializable](https://qlib.readthedocs.io/en/v0.8.4/reference/api.html#module-qlib.utils.serial.Serializable) * [FAQ](https://qlib.readthedocs.io/en/v0.8.4/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.8.4/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.8.4/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.8.4/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.8.4/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.8.4/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.8.4/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.8.4/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.8.2 documentation * [Docs](https://qlib.readthedocs.io/en/v0.8.2/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.8.2/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.8.2/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.8.2/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.8.2/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.8.2/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.8.2/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.8.2/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.8.2/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.2/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.8.2/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.8.2/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.8.2/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.8.2/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.8.2/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.2/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.8.2/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.8.2/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.2/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.8.2/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.2/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.8.2/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.8.2/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.8.2/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.8.2/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.2/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.8.2/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.8.2/component/workflow.html#task-section) * [Data Layer: Data Framework & Usage](https://qlib.readthedocs.io/en/v0.8.2/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#id9) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#id10) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#id11) * [Processor](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#id14) * [Dataset](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#id15) * [API](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#id16) * [Cache](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.8.2/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.8.2/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.2/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.8.2/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.8.2/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.8.2/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#topkdropoutstrategy) * [EnhancedIndexingStrategy](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#enhancedindexingstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.8.2/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.8.2/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.8.2/component/highfreq.html#example) * [Meta Controller: Meta-Task & Meta-Dataset & Meta-Model](https://qlib.readthedocs.io/en/v0.8.2/component/meta.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/component/meta.html#introduction) * [Meta Task](https://qlib.readthedocs.io/en/v0.8.2/component/meta.html#meta-task) * [Meta Dataset](https://qlib.readthedocs.io/en/v0.8.2/component/meta.html#meta-dataset) * [Meta Model](https://qlib.readthedocs.io/en/v0.8.2/component/meta.html#meta-model) * [General Meta Model](https://qlib.readthedocs.io/en/v0.8.2/component/meta.html#general-meta-model) * [Meta Task Model](https://qlib.readthedocs.io/en/v0.8.2/component/meta.html#meta-task-model) * [Meta Guide Model](https://qlib.readthedocs.io/en/v0.8.2/component/meta.html#meta-guide-model) * [Example](https://qlib.readthedocs.io/en/v0.8.2/component/meta.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.8.2/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.8.2/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.2/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.2/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.2/component/recorder.html#id4) * [Record Template](https://qlib.readthedocs.io/en/v0.8.2/component/recorder.html#record-template) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.8.2/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.8.2/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.2/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.8.2/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.8.2/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.8.2/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.8.2/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.8.2/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.2/component/online.html#id2) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.2/component/online.html#id6) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.2/component/online.html#id10) * [Updater](https://qlib.readthedocs.io/en/v0.8.2/component/online.html#id11) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.8.2/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.8.2/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.8.2/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.8.2/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.8.2/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.8.2/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.8.2/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.8.2/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.8.2/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.8.2/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.2/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.8.2/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.2/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.8.2/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.8.2/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.8.2/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.8.2/advanced/task_management.html#task-collecting) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#id21) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#id26) * [Serializable](https://qlib.readthedocs.io/en/v0.8.2/reference/api.html#module-qlib.utils.serial.Serializable) * [FAQ](https://qlib.readthedocs.io/en/v0.8.2/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.8.2/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.8.2/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.8.2/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.8.2/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.8.2/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.8.2/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.8.2/changelog/changelog.html#other-versions) --- # Qlib Documentation — QLib 0.8.0 documentation * [Docs](https://qlib.readthedocs.io/en/v0.8.0/#) » * `Qlib` Documentation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.8.0/docs/index.rst) * * * `Qlib` Documentation[¶](https://qlib.readthedocs.io/en/v0.8.0/#qlib-documentation "Permalink to this headline") ================================================================================================================ `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. Document Structure[¶](https://qlib.readthedocs.io/en/v0.8.0/#document-structure "Permalink to this headline") -------------------------------------------------------------------------------------------------------------- GETTING STARTED: * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/introduction/introduction.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/introduction/introduction.html#introduction) * [Framework](https://qlib.readthedocs.io/en/v0.8.0/introduction/introduction.html#framework) * [Quick Start](https://qlib.readthedocs.io/en/v0.8.0/introduction/quick.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/introduction/quick.html#introduction) * [Installation](https://qlib.readthedocs.io/en/v0.8.0/introduction/quick.html#installation) * [Prepare Data](https://qlib.readthedocs.io/en/v0.8.0/introduction/quick.html#prepare-data) * [Auto Quant Research Workflow](https://qlib.readthedocs.io/en/v0.8.0/introduction/quick.html#auto-quant-research-workflow) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.0/introduction/quick.html#custom-model-integration) FIRST STEPS: * [Installation](https://qlib.readthedocs.io/en/v0.8.0/start/installation.html) * [`Qlib` Installation](https://qlib.readthedocs.io/en/v0.8.0/start/installation.html#qlib-installation) * [Initialization](https://qlib.readthedocs.io/en/v0.8.0/start/initialization.html) * [Initialization](https://qlib.readthedocs.io/en/v0.8.0/start/initialization.html#id1) * [Parameters](https://qlib.readthedocs.io/en/v0.8.0/start/initialization.html#parameters) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.0/start/getdata.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/start/getdata.html#introduction) * [Examples](https://qlib.readthedocs.io/en/v0.8.0/start/getdata.html#examples) * [API](https://qlib.readthedocs.io/en/v0.8.0/start/getdata.html#api) * [Custom Model Integration](https://qlib.readthedocs.io/en/v0.8.0/start/integration.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/start/integration.html#introduction) * [Custom Model Class](https://qlib.readthedocs.io/en/v0.8.0/start/integration.html#custom-model-class) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.0/start/integration.html#configuration-file) * [Model Testing](https://qlib.readthedocs.io/en/v0.8.0/start/integration.html#model-testing) * [Reference](https://qlib.readthedocs.io/en/v0.8.0/start/integration.html#reference) COMPONENTS: * [Workflow: Workflow Management](https://qlib.readthedocs.io/en/v0.8.0/component/workflow.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/component/workflow.html#introduction) * [Complete Example](https://qlib.readthedocs.io/en/v0.8.0/component/workflow.html#complete-example) * [Configuration File](https://qlib.readthedocs.io/en/v0.8.0/component/workflow.html#configuration-file) * [Qlib Init Section](https://qlib.readthedocs.io/en/v0.8.0/component/workflow.html#qlib-init-section) * [Task Section](https://qlib.readthedocs.io/en/v0.8.0/component/workflow.html#task-section) * [Data Layer: Data Framework&Usage](https://qlib.readthedocs.io/en/v0.8.0/component/data.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#introduction) * [Data Preparation](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#data-preparation) * [Qlib Format Data](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#qlib-format-data) * [Qlib Format Dataset](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#qlib-format-dataset) * [Automatic update of daily frequency data](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#automatic-update-of-daily-frequency-data) * [Converting CSV Format into Qlib Format](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#converting-csv-format-into-qlib-format) * [Stock Pool (Market)](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#stock-pool-market) * [Multiple Stock Modes](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#multiple-stock-modes) * [Data API](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#data-api) * [Data Retrieval](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#data-retrieval) * [Feature](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#feature) * [Filter](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#filter) * [Reference](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#reference) * [Data Loader](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#data-loader) * [QlibDataLoader](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#qlibdataloader) * [StaticDataLoader](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#staticdataloader) * [Interface](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#interface) * [API](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#api) * [Data Handler](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#data-handler) * [DataHandlerLP](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#datahandlerlp) * [Interface](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#id7) * [Processor](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#processor) * [Example](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#id10) * [Dataset](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#dataset) * [API](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#id11) * [Cache](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#cache) * [Global Memory Cache](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#global-memory-cache) * [ExpressionCache](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#expressioncache) * [DatasetCache](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#datasetcache) * [Data and Cache File Structure](https://qlib.readthedocs.io/en/v0.8.0/component/data.html#data-and-cache-file-structure) * [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/v0.8.0/component/model.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/component/model.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.0/component/model.html#base-class-interface) * [Example](https://qlib.readthedocs.io/en/v0.8.0/component/model.html#example) * [Custom Model](https://qlib.readthedocs.io/en/v0.8.0/component/model.html#custom-model) * [API](https://qlib.readthedocs.io/en/v0.8.0/component/model.html#api) * [Portfolio Management and Backtest](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#introduction) * [Base Class & Interface](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#base-class-interface) * [BaseStrategy](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#basestrategy) * [WeightStrategyBase](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#weightstrategybase) * [Implemented Strategy](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#implemented-strategy) * [TopkDropoutStrategy](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#topkdropoutstrategy) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#usage-example) * [Prediction Score](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#prediction-score) * [Running backtest](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#running-backtest) * [Result](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#result) * [Reference](https://qlib.readthedocs.io/en/v0.8.0/component/strategy.html#reference) * [Nested Decision Execution: High-Frequency Trading](https://qlib.readthedocs.io/en/v0.8.0/component/highfreq.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/component/highfreq.html#introduction) * [Example](https://qlib.readthedocs.io/en/v0.8.0/component/highfreq.html#example) * [Qlib Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.8.0/component/recorder.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/component/recorder.html#introduction) * [Qlib Recorder](https://qlib.readthedocs.io/en/v0.8.0/component/recorder.html#qlib-recorder) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.0/component/recorder.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.0/component/recorder.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.0/component/recorder.html#id4) * [Record Template](https://qlib.readthedocs.io/en/v0.8.0/component/recorder.html#record-template) * [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/v0.8.0/component/report.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/component/report.html#introduction) * [Graphical Reports](https://qlib.readthedocs.io/en/v0.8.0/component/report.html#graphical-reports) * [Usage & Example](https://qlib.readthedocs.io/en/v0.8.0/component/report.html#usage-example) * [Usage of analysis\_position.report](https://qlib.readthedocs.io/en/v0.8.0/component/report.html#usage-of-analysis-position-report) * [Usage of analysis\_position.score\_ic](https://qlib.readthedocs.io/en/v0.8.0/component/report.html#usage-of-analysis-position-score-ic) * [Usage of analysis\_position.risk\_analysis](https://qlib.readthedocs.io/en/v0.8.0/component/report.html#usage-of-analysis-position-risk-analysis) * [Usage of analysis\_model.analysis\_model\_performance](https://qlib.readthedocs.io/en/v0.8.0/component/report.html#usage-of-analysis-model-analysis-model-performance) * [Online Serving: Online Management & Strategy & Tool](https://qlib.readthedocs.io/en/v0.8.0/component/online.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/component/online.html#introduction) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.0/component/online.html#id2) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.0/component/online.html#id6) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.0/component/online.html#id10) * [Updater](https://qlib.readthedocs.io/en/v0.8.0/component/online.html#id11) ADVANCED TOPICS: * [Building Formulaic Alphas](https://qlib.readthedocs.io/en/v0.8.0/advanced/alpha.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/advanced/alpha.html#introduction) * [Building Formulaic Alphas in `Qlib`](https://qlib.readthedocs.io/en/v0.8.0/advanced/alpha.html#building-formulaic-alphas-in-qlib) * [Example](https://qlib.readthedocs.io/en/v0.8.0/advanced/alpha.html#example) * [Reference](https://qlib.readthedocs.io/en/v0.8.0/advanced/alpha.html#reference) * [Online & Offline mode](https://qlib.readthedocs.io/en/v0.8.0/advanced/server.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/advanced/server.html#introduction) * [Qlib-Server](https://qlib.readthedocs.io/en/v0.8.0/advanced/server.html#qlib-server) * [Reference](https://qlib.readthedocs.io/en/v0.8.0/advanced/server.html#reference) * [Serialization](https://qlib.readthedocs.io/en/v0.8.0/advanced/serial.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/advanced/serial.html#introduction) * [Serializable Class](https://qlib.readthedocs.io/en/v0.8.0/advanced/serial.html#serializable-class) * [Example](https://qlib.readthedocs.io/en/v0.8.0/advanced/serial.html#example) * [API](https://qlib.readthedocs.io/en/v0.8.0/advanced/serial.html#api) * [Task Management](https://qlib.readthedocs.io/en/v0.8.0/advanced/task_management.html) * [Introduction](https://qlib.readthedocs.io/en/v0.8.0/advanced/task_management.html#introduction) * [Task Generating](https://qlib.readthedocs.io/en/v0.8.0/advanced/task_management.html#task-generating) * [Task Storing](https://qlib.readthedocs.io/en/v0.8.0/advanced/task_management.html#task-storing) * [Task Training](https://qlib.readthedocs.io/en/v0.8.0/advanced/task_management.html#task-training) * [Task Collecting](https://qlib.readthedocs.io/en/v0.8.0/advanced/task_management.html#task-collecting) REFERENCE: * [API](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html) * [Data](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#data) * [Provider](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.data.data) * [Filter](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.data.filter) * [Class](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.data.base) * [Operator](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.data.ops) * [Cache](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#cache) * [Storage](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#storage) * [Dataset](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#dataset) * [Contrib](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#contrib) * [Model](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.model.base) * [Strategy](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#strategy) * [Evaluate](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.contrib.evaluate) * [Report](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.contrib.report.analysis_position.report) * [Workflow](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#workflow) * [Experiment Manager](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#experiment-manager) * [Experiment](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#experiment) * [Recorder](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#recorder) * [Record Template](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.workflow.record_temp) * [Task Management](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#task-management) * [TaskGen](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.workflow.task.gen) * [TaskManager](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.workflow.task.manage) * [Trainer](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.model.trainer) * [Collector](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.workflow.task.collect) * [Group](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.model.ens.group) * [Ensemble](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.model.ens.ensemble) * [Utils](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.workflow.task.utils) * [Online Serving](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#online-serving) * [Online Manager](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.workflow.online.manager) * [Online Strategy](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#id21) * [Online Tool](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.workflow.online.utils) * [RecordUpdater](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.workflow.online.update) * [Utils](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#id26) * [Serializable](https://qlib.readthedocs.io/en/v0.8.0/reference/api.html#module-qlib.utils.serial.Serializable) * [FAQ](https://qlib.readthedocs.io/en/v0.8.0/FAQ/FAQ.html) * [Qlib Frequently Asked Questions](https://qlib.readthedocs.io/en/v0.8.0/FAQ/FAQ.html#qlib-frequently-asked-questions) * [1\. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase…](https://qlib.readthedocs.io/en/v0.8.0/FAQ/FAQ.html#runtimeerror-an-attempt-has-been-made-to-start-a-new-process-before-the-current-process-has-finished-its-bootstrapping-phase) * [2\. qlib.data.cache.QlibCacheException: It sees the key(…) of the redis lock has existed in your redis db now.](https://qlib.readthedocs.io/en/v0.8.0/FAQ/FAQ.html#qlib-data-cache-qlibcacheexception-it-sees-the-key-of-the-redis-lock-has-existed-in-your-redis-db-now) * [3\. ModuleNotFoundError: No module named ‘qlib.data.\_libs.rolling’](https://qlib.readthedocs.io/en/v0.8.0/FAQ/FAQ.html#modulenotfounderror-no-module-named-qlib-data-libs-rolling) * [4\. BadNamespaceError: / is not a connected namespace](https://qlib.readthedocs.io/en/v0.8.0/FAQ/FAQ.html#badnamespaceerror-is-not-a-connected-namespace) * [5\. TypeError: send() got an unexpected keyword argument ‘binary’](https://qlib.readthedocs.io/en/v0.8.0/FAQ/FAQ.html#typeerror-send-got-an-unexpected-keyword-argument-binary) Change Log: * [Change Log](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html) * [Version 0.1.0](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-1-0) * [Version 0.1.1](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-1-1) * [Version 0.1.2](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-1-2) * [Version 0.1.3](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-1-3) * [Version 0.2.0](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-2-0) * [Version 0.2.1](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-2-1) * [Version 0.2.2](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-2-2) * [Version 0.2.3](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-2-3) * [Version 0.2.4](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-2-4) * [Version 0.3.0](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-3-0) * [Version 0.3.1](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-3-1) * [Version 0.3.2](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-3-2) * [Version 0.3.3](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-3-3) * [Version 0.3.4](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-3-4) * [Version 0.3.5](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-3-5) * [Version 0.4.0](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-4-0) * [Version 0.4.1](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-4-1) * [Version 0.4.2](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-4-2) * [Version 0.4.3](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-4-3) * [Version 0.4.4](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-4-4) * [Version 0.4.5](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-4-5) * [Version 0.4.6](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-4-6) * [Version 0.5.0](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-5-0) * [Version 0.8.0](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#version-0-8-0) * [Other Versions](https://qlib.readthedocs.io/en/v0.8.0/changelog/changelog.html#other-versions) --- # Unknown \====================== \`\`Qlib\`\` Documentation ====================== \`\`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. .. \_user\_guide: Document Structure ==================== .. toctree:: :hidden: Home .. toctree:: :maxdepth: 3 :caption: GETTING STARTED: Introduction Quick Start .. toctree:: :maxdepth: 3 :caption: FIRST STEPS: Installation Initialization Data Retrieval Custom Model Integration .. toctree:: :maxdepth: 3 :caption: MAIN COMPONENTS: Workflow: Workflow Management Data Layer: Data Framework & Usage Forecast Model: Model Training & Prediction Portfolio Management and Backtest Nested Decision Execution: High-Frequency Trading Meta Controller: Meta-Task & Meta-Dataset & Meta-Model Qlib Recorder: Experiment Management Analysis: Evaluation & Results Analysis Online Serving: Online Management & Strategy & Tool Reinforcement Learning .. toctree:: :maxdepth: 3 :caption: OTHER COMPONENTS/FEATURES/TOPICS: Building Formulaic Alphas Online & Offline mode Serialization Task Management Point-In-Time database .. toctree:: :maxdepth: 3 :caption: FOR DEVELOPERS: Code Standard & Development Guidance How to build image .. toctree:: :maxdepth: 3 :caption: REFERENCE: API .. toctree:: :maxdepth: 3 FAQ .. toctree:: :maxdepth: 3 :caption: Change Log: Change Log --- # Unknown \====================== \`\`Qlib\`\` Documentation ====================== \`\`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. .. \_user\_guide: Document Structure ==================== .. toctree:: :hidden: Home .. toctree:: :maxdepth: 3 :caption: GETTING STARTED: Introduction Quick Start .. toctree:: :maxdepth: 3 :caption: FIRST STEPS: Installation Initialization Data Retrieval Custom Model Integration .. toctree:: :maxdepth: 3 :caption: MAIN COMPONENTS: Workflow: Workflow Management Data Layer: Data Framework & Usage Forecast Model: Model Training & Prediction Portfolio Management and Backtest Nested Decision Execution: High-Frequency Trading Meta Controller: Meta-Task & Meta-Dataset & Meta-Model Qlib Recorder: Experiment Management Analysis: Evaluation & Results Analysis Online Serving: Online Management & Strategy & Tool Reinforcement Learning .. toctree:: :maxdepth: 3 :caption: OTHER COMPONENTS/FEATURES/TOPICS: Building Formulaic Alphas Online & Offline mode Serialization Task Management Point-In-Time database .. toctree:: :maxdepth: 3 :caption: FOR DEVELOPERS: Code Standard & Development Guidance How to build image .. toctree:: :maxdepth: 3 :caption: REFERENCE: API .. toctree:: :maxdepth: 3 FAQ .. toctree:: :maxdepth: 3 :caption: Change Log: Change Log --- # Unknown \====================== \`\`Qlib\`\` Documentation ====================== \`\`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. .. \_user\_guide: Document Structure ==================== .. toctree:: :hidden: Home .. toctree:: :maxdepth: 3 :caption: GETTING STARTED: Introduction Quick Start .. toctree:: :maxdepth: 3 :caption: FIRST STEPS: Installation Initialization Data Retrieval Custom Model Integration .. toctree:: :maxdepth: 3 :caption: MAIN COMPONENTS: Workflow: Workflow Management Data Layer: Data Framework & Usage Forecast Model: Model Training & Prediction Portfolio Management and Backtest Nested Decision Execution: High-Frequency Trading Meta Controller: Meta-Task & Meta-Dataset & Meta-Model Qlib Recorder: Experiment Management Analysis: Evaluation & Results Analysis Online Serving: Online Management & Strategy & Tool Reinforcement Learning .. toctree:: :maxdepth: 3 :caption: OTHER COMPONENTS/FEATURES/TOPICS: Building Formulaic Alphas Online & Offline mode Serialization Task Management Point-In-Time database .. toctree:: :maxdepth: 3 :caption: FOR DEVELOPERS: Code Standard & Development Guidance How to build image .. toctree:: :maxdepth: 3 :caption: REFERENCE: API .. toctree:: :maxdepth: 3 FAQ .. toctree:: :maxdepth: 3 :caption: Change Log: Change Log --- # Unknown \====================== \`\`Qlib\`\` Documentation ====================== \`\`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. .. \_user\_guide: Document Structure ==================== .. toctree:: :hidden: Home .. toctree:: :maxdepth: 3 :caption: GETTING STARTED: Introduction Quick Start .. toctree:: :maxdepth: 3 :caption: FIRST STEPS: Installation Initialization Data Retrieval Custom Model Integration .. toctree:: :maxdepth: 3 :caption: MAIN COMPONENTS: Workflow: Workflow Management Data Layer: Data Framework & Usage Forecast Model: Model Training & Prediction Portfolio Management and Backtest Nested Decision Execution: High-Frequency Trading Meta Controller: Meta-Task & Meta-Dataset & Meta-Model Qlib Recorder: Experiment Management Analysis: Evaluation & Results Analysis Online Serving: Online Management & Strategy & Tool Reinforcement Learning .. toctree:: :maxdepth: 3 :caption: OTHER COMPONENTS/FEATURES/TOPICS: Building Formulaic Alphas Online & Offline mode Serialization Task Management Point-In-Time database .. toctree:: :maxdepth: 3 :caption: FOR DEVELOPERS: Code Standard & Development Guidance How to build image .. toctree:: :maxdepth: 3 :caption: REFERENCE: API .. toctree:: :maxdepth: 3 FAQ .. toctree:: :maxdepth: 3 :caption: Change Log: Change Log --- # Qlib: Quantitative Platform — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * `Qlib`: Quantitative Platform * [View page source](https://qlib.readthedocs.io/en/latest/_sources/introduction/introduction.rst.txt) * * * `Qlib`: Quantitative Platform[](https://qlib.readthedocs.io/en/latest/introduction/introduction.html#qlib-quantitative-platform "Permalink to this heading") ============================================================================================================================================================== Introduction[](https://qlib.readthedocs.io/en/latest/introduction/introduction.html#introduction "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------------- ![../_images/white_bg_rec%2Bword.png](https://qlib.readthedocs.io/en/latest/_images/white_bg_rec%2Bword.png) `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`, users can easily try their ideas to create better Quant investment strategies. Framework[](https://qlib.readthedocs.io/en/latest/introduction/introduction.html#framework "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------- ![../_images/framework.svg](https://qlib.readthedocs.io/en/latest/_images/framework.svg) At the module level, Qlib is a platform that consists of above components. The components are designed as loose-coupled modules and each component could be used stand-alone. This framework may be intimidating for new users to Qlib. It tries to accurately include a lot of details of Qlib’s design. For users new to Qlib, you can skip it first and read it later. | Name | Description | | --- | --- | | Infrastructure layer | Infrastructure layer provides underlying support for Quant research. DataServer provides high-performance infrastructure for users to manage and retrieve raw data. Trainer provides flexible interface to control the training process of models which enable algorithms controlling the training process. | | Learning Framework layer | The Forecast Model and Trading Agent are trainable. They are trained based on the Learning Framework layer and then applied to multiple scenarios in Workflow layer. The supported learning paradigms can be categorized into reinforcement learning and supervised learning. The learning framework leverages the Workflow layer as well(e.g. sharing Information Extractor, creating environments based on Execution Env). | | Workflow layer | Workflow layer covers the whole workflow of quantitative investment. Both supervised-learning-based strategies and RL-based Strategies are supported. Information Extractor extracts data for models. Forecast Model focuses on producing all kinds of forecast signals (e.g. _alpha_, risk) for other modules. With these signals Decision Generator will generate the target trading decisions(i.e. portfolio, orders) If RL-based Strategies are adopted, the Policy is learned in a end-to-end way, the trading decisions are generated directly. Decisions will be executed by Execution Env (i.e. the trading market). There may be multiple levels of Strategy and Executor (e.g. an _order executor trading strategy and intraday order executor_ could behave like an interday trading loop and be nested in _daily portfolio management trading strategy and interday trading executor_ trading loop) | | Interface layer | Interface layer tries to present a user-friendly interface for the underlying system. Analyser module will provide users detailed analysis reports of forecasting signals, portfolios and execution results | * The modules with hand-drawn style are under development and will be released in the future. * The modules with dashed borders are highly user-customizable and extendible. (p.s. framework image is created with [https://draw.io/](https://draw.io/) ) --- # Installation — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Installation * [View page source](https://qlib.readthedocs.io/en/latest/_sources/start/installation.rst.txt) * * * Installation[](https://qlib.readthedocs.io/en/latest/start/installation.html#installation "Permalink to this heading") ======================================================================================================================== `Qlib` Installation[](https://qlib.readthedocs.io/en/latest/start/installation.html#qlib-installation "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------------------ Note Qlib supports both Windows and Linux. It’s recommended to use Qlib in Linux. `Qlib` supports Python3, which is up to Python3.8. Users can easily install `Qlib` by pip according to the following command: pip install pyqlib Also, Users can install `Qlib` by the source code according to the following steps: * Enter the root directory of `Qlib`, in which the file `setup.py` exists. * Then, please execute the following command to install the environment dependencies and install `Qlib`: > $ pip install numpy > $ pip install \--upgrade cython > $ git clone https://github.com/microsoft/qlib.git && cd qlib > $ python setup.py install Note It’s recommended to use anaconda/miniconda to setup the environment. `Qlib` needs lightgbm and pytorch packages, use pip to install them. Use the following code to make sure the installation successful: \>>> import qlib \>>> qlib.\_\_version\_\_ --- # Reinforcement Learning in Quantitative Trading — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Reinforcement Learning in Quantitative Trading * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/rl/toctree.rst.txt) * * * Reinforcement Learning in Quantitative Trading[](https://qlib.readthedocs.io/en/latest/component/rl/toctree.html#reinforcement-learning-in-quantitative-trading "Permalink to this heading") ============================================================================================================================================================================================== * [Guidance](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html) * [Beginners to Reinforcement Learning Algorithms](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html#beginners-to-reinforcement-learning-algorithms) * [Reinforcement Learning Algorithm Researcher](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html#reinforcement-learning-algorithm-researcher) * [Quantitative Researcher](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html#quantitative-researcher) * [Overall](https://qlib.readthedocs.io/en/latest/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Order Execution](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#order-execution) * [Portfolio Construction](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#portfolio-construction) * [Quick Start](https://qlib.readthedocs.io/en/latest/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/latest/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/latest/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/latest/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/latest/component/rl/framework.html#training-vessel-trainer) --- # Qlib Initialization — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Qlib Initialization * [View page source](https://qlib.readthedocs.io/en/latest/_sources/start/initialization.rst.txt) * * * Qlib Initialization[](https://qlib.readthedocs.io/en/latest/start/initialization.html#qlib-initialization "Permalink to this heading") ======================================================================================================================================== Initialization[](https://qlib.readthedocs.io/en/latest/start/initialization.html#id1 "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------- Please follow the steps below to initialize `Qlib`. Download and prepare the Data: execute the following command to download stock data. Please pay attention that the data is collected from [Yahoo Finance](https://finance.yahoo.com/lookup) and the data might not be perfect. We recommend users to prepare their own data if they have high-quality datasets. Please refer to [Data](https://qlib.readthedocs.io/en/latest/component/data.html#converting-csv-format-into-qlib-format) for more information about customized dataset. > python scripts/get\_data.py qlib\_data \--target\_dir ~/.qlib/qlib\_data/cn\_data \--region cn Please refer to [Data Preparation](https://qlib.readthedocs.io/en/latest/component/data.html#data-preparation) for more information about get\_data.py, Initialize Qlib before calling other APIs: run following code in python. > import qlib > \# region in \[REG\_CN, REG\_US\] > from qlib.constant import REG\_CN > provider\_uri \= "~/.qlib/qlib\_data/cn\_data" \# target\_dir > qlib.init(provider\_uri\=provider\_uri, region\=REG\_CN) Note Do not import qlib package in the repository directory of `Qlib`, otherwise, errors may occur. ### Parameters[](https://qlib.readthedocs.io/en/latest/start/initialization.html#parameters "Permalink to this heading") Besides provider\_uri and region, qlib.init has other parameters. The following are several important parameters of qlib.init (Qlib has a lot of config. Only part of parameters are limited here. More detailed setting can be found [here](https://github.com/microsoft/qlib/blob/main/qlib/config.py) ): * provider\_uri Type: str. The URI of the Qlib data. For example, it could be the location where the data loaded by `get_data.py` are stored. * region Type: str, optional parameter(default: qlib.constant.REG\_CN). Currently: `qlib.constant.REG_US` (‘us’) and `qlib.constant.REG_CN` (‘cn’) is supported. Different value of region will result in different stock market mode. - `qlib.constant.REG_US`: US stock market. - `qlib.constant.REG_CN`: China stock market. Different modes will result in different trading limitations and costs. The region is just [shortcuts for defining a batch of configurations](https://github.com/microsoft/qlib/blob/528f74af099bf6156e9480bcd2bb28e453231212/qlib/config.py#L249) , which include minimal trading order unit (`trade_unit`), trading limitation (`limit_threshold`) , etc. It is not a necessary part and users can set the key configurations manually if the existing region setting can’t meet their requirements. * redis\_host Type: str, optional parameter(default: “127.0.0.1”), host of redis The lock and cache mechanism relies on redis. * redis\_port Type: int, optional parameter(default: 6379), port of redis Note The value of region should be aligned with the data stored in provider\_uri. Currently, `scripts/get_data.py` only provides China stock market data. If users want to use the US stock market data, they should prepare their own US-stock data in provider\_uri and switch to US-stock mode. Note If Qlib fails to connect redis via redis\_host and redis\_port, cache mechanism will not be used! Please refer to [Cache](https://qlib.readthedocs.io/en/latest/component/data.html#cache) for details. * exp\_manager Type: dict, optional parameter, the setting of experiment manager to be used in qlib. Users can specify an experiment manager class, as well as the tracking URI for all the experiments. However, please be aware that we only support input of a dictionary in the following style for exp\_manager. For more information about exp\_manager, users can refer to [Recorder: Experiment Management](https://qlib.readthedocs.io/en/latest/component/recorder.html) . \# For example, if you want to set your tracking\_uri to a , you can initialize qlib below qlib.init(provider\_uri\=provider\_uri, region\=REG\_CN, exp\_manager\= { "class": "MLflowExpManager", "module\_path": "qlib.workflow.expm", "kwargs": { "uri": "python\_execution\_path/mlruns", "default\_exp\_name": "Experiment", } }) * mongo Type: dict, optional parameter, the setting of [MongoDB](https://www.mongodb.com/) which will be used in some features such as [Task Management](https://qlib.readthedocs.io/en/latest/advanced/task_management.html) , with high performance and clustered processing. Users need to follow the steps in [installation](https://www.mongodb.com/try/download/community) to install MongoDB firstly and then access it via a URI. Users can access mongodb with credential by setting “task\_url” to a string like “mongodb://%s:%s@%s” % (user, pwd, host + “:” + port). \# For example, you can initialize qlib below qlib.init(provider\_uri\=provider\_uri, region\=REG\_CN, mongo\={ "task\_url": "mongodb://localhost:27017/", \# your mongo url "task\_db\_name": "rolling\_db", \# the database name of Task Management }) * logging\_level The logging level for the system. * kernels The number of processes used when calculating features in Qlib’s expression engine. It is very helpful to set it to 1 when you are debuggin an expression calculating exception --- # Quick Start — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Quick Start * [View page source](https://qlib.readthedocs.io/en/latest/_sources/introduction/quick.rst.txt) * * * Quick Start[](https://qlib.readthedocs.io/en/latest/introduction/quick.html#quick-start "Permalink to this heading") ====================================================================================================================== Introduction[](https://qlib.readthedocs.io/en/latest/introduction/quick.html#introduction "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------ This `Quick Start` guide tries to demonstrate * It’s very easy to build a complete Quant research workflow and try users’ ideas with `Qlib`. * Though with public data and simple models, machine learning technologies work very well in practical Quant investment. Installation[](https://qlib.readthedocs.io/en/latest/introduction/quick.html#installation "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------ Users can easily install `Qlib` according to the following steps: * Before installing `Qlib` from source, users need to install some dependencies: > pip install numpy > pip install \--upgrade cython * Clone the repository and install `Qlib` > git clone https://github.com/microsoft/qlib.git && cd qlib > python setup.py install To known more about installation, please refer to [Qlib Installation](https://qlib.readthedocs.io/en/latest/start/installation.html) . Prepare Data[](https://qlib.readthedocs.io/en/latest/introduction/quick.html#prepare-data "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------ Load and prepare data by running the following code: python scripts/get\_data.py qlib\_data \--target\_dir ~/.qlib/qlib\_data/cn\_data \--region cn This dataset is created by public data collected by crawler scripts in `scripts/data_collector/`, which have been released in the same repository. Users could create the same dataset with it. To known more about prepare data, please refer to [Data Preparation](https://qlib.readthedocs.io/en/latest/component/data.html#data-preparation) . Auto Quant Research Workflow[](https://qlib.readthedocs.io/en/latest/introduction/quick.html#auto-quant-research-workflow "Permalink to this heading") -------------------------------------------------------------------------------------------------------------------------------------------------------- `Qlib` provides a tool named `qrun` to run the whole workflow automatically (including building dataset, training models, backtest and evaluation). Users can start an auto quant research workflow and have a graphical reports analysis according to the following steps: * Quant Research Workflow: * Run `qrun` with a config file of the LightGBM model workflow\_config\_lightgbm.yaml as following. > cd examples \# Avoid running program under the directory contains \`qlib\` > qrun benchmarks/LightGBM/workflow\_config\_lightgbm.yaml * Workflow result The result of `qrun` is as follows, which is also the typical result of `Forecast model(alpha)`. Please refer to [Intraday Trading](https://qlib.readthedocs.io/en/latest/component/backtest.html) . for more details about the result. risk excess\_return\_without\_cost mean 0.000605 std 0.005481 annualized\_return 0.152373 information\_ratio 1.751319 max\_drawdown \-0.059055 excess\_return\_with\_cost mean 0.000410 std 0.005478 annualized\_return 0.103265 information\_ratio 1.187411 max\_drawdown \-0.075024 To know more about workflow and qrun, please refer to [Workflow: Workflow Management](https://qlib.readthedocs.io/en/latest/component/workflow.html) . * Graphical Reports Analysis: * Run `examples/workflow_by_code.ipynb` with jupyter notebook Users can have portfolio analysis or prediction score (model prediction) analysis by run `examples/workflow_by_code.ipynb`. * Graphical Reports Users can get graphical reports about the analysis, please refer to [Analysis: Evaluation & Results Analysis](https://qlib.readthedocs.io/en/latest/component/report.html) for more details. Custom Model Integration[](https://qlib.readthedocs.io/en/latest/introduction/quick.html#custom-model-integration "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------ `Qlib` provides a batch of models (such as `lightGBM` and `MLP` models) as examples of `Forecast Model`. In addition to the default model, users can integrate their own custom models into `Qlib`. If users are interested in the custom model, please refer to [Custom Model Integration](https://qlib.readthedocs.io/en/latest/start/integration.html) . --- # Data Retrieval — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Data Retrieval * [View page source](https://qlib.readthedocs.io/en/latest/_sources/start/getdata.rst.txt) * * * Data Retrieval[](https://qlib.readthedocs.io/en/latest/start/getdata.html#data-retrieval "Permalink to this heading") ======================================================================================================================= Introduction[](https://qlib.readthedocs.io/en/latest/start/getdata.html#introduction "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------- Users can get stock data with `Qlib`. The following examples demonstrate the basic user interface. Examples[](https://qlib.readthedocs.io/en/latest/start/getdata.html#examples "Permalink to this heading") ----------------------------------------------------------------------------------------------------------- `QLib` Initialization: Note In order to get the data, users need to initialize `Qlib` with qlib.init first. Please refer to [initialization](https://qlib.readthedocs.io/en/latest/start/initialization.html) . If users followed steps in [initialization](https://qlib.readthedocs.io/en/latest/start/initialization.html) and downloaded the data, they should use the following code to initialize qlib \>> import qlib \>> qlib.init(provider\_uri\='~/.qlib/qlib\_data/cn\_data') Load trading calendar with given time range and frequency: \>> from qlib.data import D \>> D.calendar(start\_time\='2010-01-01', end\_time\='2017-12-31', freq\='day')\[:2\] \[Timestamp('2010-01-04 00:00:00'), Timestamp('2010-01-05 00:00:00')\] Parse a given market name into a stock pool config: \>> from qlib.data import D \>> D.instruments(market\='all') {'market': 'all', 'filter\_pipe': \[\]} Load instruments of certain stock pool in the given time range: \>> from qlib.data import D \>> instruments \= D.instruments(market\='csi300') \>> D.list\_instruments(instruments\=instruments, start\_time\='2010-01-01', end\_time\='2017-12-31', as\_list\=True)\[:6\] \['SH600036', 'SH600110', 'SH600087', 'SH600900', 'SH600089', 'SZ000912'\] Load dynamic instruments from a base market according to a name filter \>> from qlib.data import D \>> from qlib.data.filter import NameDFilter \>> nameDFilter \= NameDFilter(name\_rule\_re\='SH\[0-9\]{4}55') \>> instruments \= D.instruments(market\='csi300', filter\_pipe\=\[nameDFilter\]) \>> D.list\_instruments(instruments\=instruments, start\_time\='2015-01-01', end\_time\='2016-02-15', as\_list\=True) \['SH600655', 'SH601555'\] Load dynamic instruments from a base market according to an expression filter \>> from qlib.data import D \>> from qlib.data.filter import ExpressionDFilter \>> expressionDFilter \= ExpressionDFilter(rule\_expression\='$close>2000') \>> instruments \= D.instruments(market\='csi300', filter\_pipe\=\[expressionDFilter\]) \>> D.list\_instruments(instruments\=instruments, start\_time\='2015-01-01', end\_time\='2016-02-15', as\_list\=True) \['SZ000651', 'SZ000002', 'SH600655', 'SH600570'\] For more details about filter, please refer [Filter API](https://qlib.readthedocs.io/en/latest/component/data.html) . Load features of certain instruments in a given time range: \>> from qlib.data import D \>> instruments \= \['SH600000'\] \>> fields \= \['$close', '$volume', 'Ref($close, 1)', 'Mean($close, 3)', '$high-$low'\] \>> D.features(instruments, fields, start\_time\='2010-01-01', end\_time\='2017-12-31', freq\='day').head().to\_string() ' $close $volume Ref($close, 1) Mean($close, 3) $high-$low ... instrument datetime ... SH600000 2010\-01\-04 86.778313 16162960.0 88.825928 88.061483 2.907631 ... 2010\-01\-05 87.433578 28117442.0 86.778313 87.679273 3.235252 ... 2010\-01\-06 85.713585 23632884.0 87.433578 86.641825 1.720009 ... 2010\-01\-07 83.788803 20813402.0 85.713585 85.645322 3.030487 ... 2010\-01\-08 84.730675 16044853.0 83.788803 84.744354 2.047623' Load features of certain stock pool in a given time range: Note With cache enabled, the qlib data server will cache data all the time for the requested stock pool and fields, it may take longer to process the request for the first time than that without cache. But after the first time, requests with the same stock pool and fields will hit the cache and be processed faster even the requested time period changes. \>> from qlib.data import D \>> from qlib.data.filter import NameDFilter, ExpressionDFilter \>> nameDFilter \= NameDFilter(name\_rule\_re\='SH\[0-9\]{4}55') \>> expressionDFilter \= ExpressionDFilter(rule\_expression\='$close>Ref($close,1)') \>> instruments \= D.instruments(market\='csi300', filter\_pipe\=\[nameDFilter, expressionDFilter\]) \>> fields \= \['$close', '$volume', 'Ref($close, 1)', 'Mean($close, 3)', '$high-$low'\] \>> D.features(instruments, fields, start\_time\='2010-01-01', end\_time\='2017-12-31', freq\='day').head().to\_string() ' $close $volume Ref($close, 1) Mean($close, 3) $high-$low ... instrument datetime ... SH600655 2010\-01\-04 2699.567383 158193.328125 2619.070312 2626.097738 124.580566 ... 2010\-01\-08 2612.359619 77501.406250 2584.567627 2623.220133 83.373047 ... 2010\-01\-11 2712.982422 160852.390625 2612.359619 2636.636556 146.621582 ... 2010\-01\-12 2788.688232 164587.937500 2712.982422 2704.676758 128.413818 ... 2010\-01\-13 2790.604004 145460.453125 2788.688232 2764.091553 128.413818' For more details about features, please refer [Feature API](https://qlib.readthedocs.io/en/latest/component/data.html) . Note When calling D.features() at the client, use parameter disk\_cache=0 to skip dataset cache, use disk\_cache=1 to generate and use dataset cache. In addition, when calling at the server, users can use disk\_cache=2 to update the dataset cache. When you are building complicated expressions, implementing all the expressions in a single string may not be easy. For example, it looks quite long and complicated: \>> from qlib.data import D \>> data \= D.features(\["sh600519"\], \["(($high / $close) + ($open / $close)) \* (($high / $close) + ($open / $close)) / (($high / $close) + ($open / $close))"\], start\_time\="20200101") But using string is not the only way to implement the expression. You can also implement expression by code. Here is an example which does the same thing as above examples. \>> from qlib.data.ops import \* \>> f1 \= Feature("high") / Feature("close") \>> f2 \= Feature("open") / Feature("close") \>> f3 \= f1 + f2 \>> f4 \= f3 \* f3 / f3 \>> data \= D.features(\["sh600519"\], \[f4\], start\_time\="20200101") \>> data.head() API[](https://qlib.readthedocs.io/en/latest/start/getdata.html#api "Permalink to this heading") ------------------------------------------------------------------------------------------------- To know more about how to use the Data, go to API Reference: [Data API](https://qlib.readthedocs.io/en/latest/reference/api.html#data) --- # Design of Nested Decision Execution Framework for High-Frequency Trading — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Design of Nested Decision Execution Framework for High-Frequency Trading * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/highfreq.rst.txt) * * * Design of Nested Decision Execution Framework for High-Frequency Trading[](https://qlib.readthedocs.io/en/latest/component/highfreq.html#design-of-nested-decision-execution-framework-for-high-frequency-trading "Permalink to this heading") ================================================================================================================================================================================================================================================ Introduction[](https://qlib.readthedocs.io/en/latest/component/highfreq.html#introduction "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------ Daily trading (e.g. portfolio management) and intraday trading (e.g. orders execution) are two hot topics in Quant investment and are usually studied separately. To get the join trading performance of daily and intraday trading, they must interact with each other and run backtest jointly. In order to support the joint backtest strategies at multiple levels, a corresponding framework is required. None of the publicly available high-frequency trading frameworks considers multi-level joint trading, which makes the backtesting aforementioned inaccurate. Besides backtesting, the optimization of strategies from different levels is not standalone and can be affected by each other. For example, the best portfolio management strategy may change with the performance of order executions(e.g. a portfolio with higher turnover may become a better choice when we improve the order execution strategies). To achieve overall good performance, it is necessary to consider the interaction of strategies at a different levels. Therefore, building a new framework for trading on multiple levels becomes necessary to solve the various problems mentioned above, for which we designed a nested decision execution framework that considers the interaction of strategies. ![../_images/framework.svg](https://qlib.readthedocs.io/en/latest/_images/framework.svg) The design of the framework is shown in the yellow part in the middle of the figure above. Each level consists of `Trading Agent` and `Execution Env`. `Trading Agent` has its own data processing module (`Information Extractor`), forecasting module (`Forecast Model`) and decision generator (`Decision Generator`). The trading algorithm generates the decisions by the `Decision Generator` based on the forecast signals output by the `Forecast Module`, and the decisions generated by the trading algorithm are passed to the `Execution Env`, which returns the execution results. The frequency of the trading algorithm, decision content and execution environment can be customized by users (e.g. intraday trading, daily-frequency trading, weekly-frequency trading), and the execution environment can be nested with finer-grained trading algorithm and execution environment inside (i.e. sub-workflow in the figure, e.g. daily-frequency orders can be turned into finer-grained decisions by splitting orders within the day). The flexibility of the nested decision execution framework makes it easy for users to explore the effects of combining different levels of trading strategies and break down the optimization barriers between different levels of the trading algorithm. The optimization for the nested decision execution framework can be implemented with the support of [QlibRL](https://qlib.readthedocs.io/en/latest/component/rl/overall.html) . To know more about how to use the QlibRL, go to API Reference: [RL API](https://qlib.readthedocs.io/en/latest/reference/api.html#rl) . Example[](https://qlib.readthedocs.io/en/latest/component/highfreq.html#example "Permalink to this heading") -------------------------------------------------------------------------------------------------------------- An example of a nested decision execution framework for high-frequency can be found [here](https://github.com/microsoft/qlib/blob/main/examples/nested_decision_execution/workflow.py) . Besides, the above examples, here are some other related works about high-frequency trading in Qlib. * [Prediction with high-frequency data](https://github.com/microsoft/qlib/tree/main/examples/highfreq#benchmarks-performance-predicting-the-price-trend-in-high-frequency-data) * [Examples](https://github.com/microsoft/qlib/blob/main/examples/orderbook_data/) to extract features from high-frequency data without fixed frequency. * [A paper](https://github.com/microsoft/qlib/tree/high-freq-execution#high-frequency-execution) for high-frequency trading. --- # Custom Model Integration — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Custom Model Integration * [View page source](https://qlib.readthedocs.io/en/latest/_sources/start/integration.rst.txt) * * * Custom Model Integration[](https://qlib.readthedocs.io/en/latest/start/integration.html#custom-model-integration "Permalink to this heading") =============================================================================================================================================== Introduction[](https://qlib.readthedocs.io/en/latest/start/integration.html#introduction "Permalink to this heading") ----------------------------------------------------------------------------------------------------------------------- `Qlib`’s Model Zoo includes models such as `LightGBM`, `MLP`, `LSTM`, etc.. These models are examples of `Forecast Model`. In addition to the default models `Qlib` provide, users can integrate their own custom models into `Qlib`. Users can integrate their own custom models according to the following steps. * Define a custom model class, which should be a subclass of the [qlib.model.base.Model](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.base) . * Write a configuration file that describes the path and parameters of the custom model. * Test the custom model. Custom Model Class[](https://qlib.readthedocs.io/en/latest/start/integration.html#custom-model-class "Permalink to this heading") ----------------------------------------------------------------------------------------------------------------------------------- The Custom models need to inherit [qlib.model.base.Model](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.base) and override the methods in it. * Override the \_\_init\_\_ method * `Qlib` passes the initialized parameters to the \_\_init\_\_ method. * The hyperparameters of model in the configuration must be consistent with those defined in the \_\_init\_\_ method. * Code Example: In the following example, the hyperparameters of model in the configuration file should contain parameters such as loss:mse. > def \_\_init\_\_(self, loss\='mse', \*\*kwargs): > if loss not in {'mse', 'binary'}: > raise NotImplementedError > self.\_scorer \= mean\_squared\_error if loss \== 'mse' else roc\_auc\_score > self.\_params.update(objective\=loss, \*\*kwargs) > self.\_model \= None * Override the fit method * `Qlib` calls the fit method to train the model. * The parameters must include training feature dataset, which is designed in the interface. * The parameters could include some optional parameters with default values, such as num\_boost\_round = 1000 for GBDT. * Code Example: In the following example, num\_boost\_round = 1000 is an optional parameter. > def fit(self, dataset: DatasetH, num\_boost\_round \= 1000, \*\*kwargs): > > \# prepare dataset for lgb training and evaluation > df\_train, df\_valid \= dataset.prepare( > \["train", "valid"\], col\_set\=\["feature", "label"\], data\_key\=DataHandlerLP.DK\_L > ) > x\_train, y\_train \= df\_train\["feature"\], df\_train\["label"\] > x\_valid, y\_valid \= df\_valid\["feature"\], df\_valid\["label"\] > > \# Lightgbm need 1D array as its label > if y\_train.values.ndim \== 2 and y\_train.values.shape\[1\] \== 1: > y\_train, y\_valid \= np.squeeze(y\_train.values), np.squeeze(y\_valid.values) > else: > raise ValueError("LightGBM doesn't support multi-label training") > > dtrain \= lgb.Dataset(x\_train.values, label\=y\_train) > dvalid \= lgb.Dataset(x\_valid.values, label\=y\_valid) > > \# fit the model > self.model \= lgb.train( > self.params, > dtrain, > num\_boost\_round\=num\_boost\_round, > valid\_sets\=\[dtrain, dvalid\], > valid\_names\=\["train", "valid"\], > early\_stopping\_rounds\=early\_stopping\_rounds, > verbose\_eval\=verbose\_eval, > evals\_result\=evals\_result, > \*\*kwargs > ) * Override the predict method * The parameters must include the parameter dataset, which will be used to get the test dataset. * Return the prediction score. * Please refer to [Model API](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.base) for the parameter types of the fit method. * Code Example: In the following example, users need to use LightGBM to predict the label(such as preds) of test data x\_test and return it. > def predict(self, dataset: DatasetH, \*\*kwargs)\-> pandas.Series: > if self.model is None: > raise ValueError("model is not fitted yet!") > x\_test \= dataset.prepare("test", col\_set\="feature", data\_key\=DataHandlerLP.DK\_I) > return pd.Series(self.model.predict(x\_test.values), index\=x\_test.index) * Override the finetune method (Optional) * This method is optional to the users. When users want to use this method on their own models, they should inherit the `ModelFT` base class, which includes the interface of finetune. * The parameters must include the parameter dataset. * Code Example: In the following example, users will use LightGBM as the model and finetune it. > def finetune(self, dataset: DatasetH, num\_boost\_round\=10, verbose\_eval\=20): > \# Based on existing model and finetune by train more rounds > dtrain, \_ \= self.\_prepare\_data(dataset) > self.model \= lgb.train( > self.params, > dtrain, > num\_boost\_round\=num\_boost\_round, > init\_model\=self.model, > valid\_sets\=\[dtrain\], > valid\_names\=\["train"\], > verbose\_eval\=verbose\_eval, > ) Configuration File[](https://qlib.readthedocs.io/en/latest/start/integration.html#configuration-file "Permalink to this heading") ----------------------------------------------------------------------------------------------------------------------------------- The configuration file is described in detail in the [Workflow](https://qlib.readthedocs.io/en/latest/component/workflow.html#complete-example) document. In order to integrate the custom model into `Qlib`, users need to modify the “model” field in the configuration file. The configuration describes which models to use and how we can initialize it. * Example: The following example describes the model field of configuration file about the custom lightgbm model mentioned above, where module\_path is the module path, class is the class name, and args is the hyperparameter passed into the \_\_init\_\_ method. All parameters in the field is passed to self.\_params by \*\*kwargs in \_\_init\_\_ except loss = mse. > model: > class: LGBModel > module\_path: qlib.contrib.model.gbdt > args: > loss: mse > colsample\_bytree: 0.8879 > learning\_rate: 0.0421 > subsample: 0.8789 > lambda\_l1: 205.6999 > lambda\_l2: 580.9768 > max\_depth: 8 > num\_leaves: 210 > num\_threads: 20 Users could find configuration file of the baselines of the `Model` in `examples/benchmarks`. All the configurations of different models are listed under the corresponding model folder. Model Testing[](https://qlib.readthedocs.io/en/latest/start/integration.html#model-testing "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------- Assuming that the configuration file is `examples/benchmarks/LightGBM/workflow_config_lightgbm.yaml`, users can run the following command to test the custom model: cd examples \# Avoid running program under the directory contains \`qlib\` qrun benchmarks/LightGBM/workflow\_config\_lightgbm.yaml Note `qrun` is a built-in command of `Qlib`. Also, `Model` can also be tested as a single module. An example has been given in `examples/workflow_by_code.ipynb`. Reference[](https://qlib.readthedocs.io/en/latest/start/integration.html#reference "Permalink to this heading") ----------------------------------------------------------------------------------------------------------------- To know more about `Forecast Model`, please refer to [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/latest/component/model.html) and [Model API](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.base) . --- # Guidance — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * [Reinforcement Learning in Quantitative Trading](https://qlib.readthedocs.io/en/latest/component/rl/toctree.html) * Guidance * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/rl/guidance.rst.txt) * * * Guidance[](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html#guidance "Permalink to this heading") =================================================================================================================== QlibRL can help users quickly get started and conveniently implement quantitative strategies based on reinforcement learning(RL) algorithms. For different user groups, we recommend the following guidance to use QlibRL. Beginners to Reinforcement Learning Algorithms[](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html#beginners-to-reinforcement-learning-algorithms "Permalink to this heading") ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Whether you are a quantitative researcher who wants to understand what RL can do in trading or a learner who wants to get started with RL algorithms in trading scenarios, if you have limited knowledge of RL and want to shield various detailed settings to quickly get started with RL algorithms, we recommend the following sequence to learn qlibrl: * Learn the fundamentals of RL in [part1](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#reinforcement-learning) . * Understand the trading scenarios where RL methods can be applied in [part2](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) . * Run the examples in [part3](https://qlib.readthedocs.io/en/latest/component/rl/quickstart.html) to solve trading problems using RL. * If you want to further explore QlibRL and make some customizations, you need to first understand the framework of QlibRL in [part4](https://qlib.readthedocs.io/en/latest/component/rl/framework.html) and rewrite specific components according to your needs. Reinforcement Learning Algorithm Researcher[](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html#reinforcement-learning-algorithm-researcher "Permalink to this heading") ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If you are already familiar with existing RL algorithms and dedicated to researching RL algorithms but lack domain knowledge in the financial field, and you want to validate the effectiveness of your algorithms in financial trading scenarios, we recommend the following steps to get started with QlibRL: * Understand the trading scenarios where RL methods can be applied in [part2](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) . * Choose an RL application scenario (currently, QlibRL has implemented two scenario examples: order execution and algorithmic trading). Run the example in [part3](https://qlib.readthedocs.io/en/latest/component/rl/quickstart.html) to get it working. * Modify the [policy](https://github.com/microsoft/qlib/blob/main/qlib/rl/order_execution/policy.py) part to incorporate your own RL algorithm. Quantitative Researcher[](https://qlib.readthedocs.io/en/latest/component/rl/guidance.html#quantitative-researcher "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------- If you have a certain level of financial domain knowledge and coding skills, and you want to explore the application of RL algorithms in the investment field, we recommend the following steps to explore QlibRL: * Learn the fundamentals of RL in [part1](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#reinforcement-learning) . * Understand the trading scenarios where RL methods can be applied in [part2](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) . * Run the examples in [part3](https://qlib.readthedocs.io/en/latest/component/rl/quickstart.html) to solve trading problems using RL. * Understand the framework of QlibRL in [part4](https://qlib.readthedocs.io/en/latest/component/rl/framework.html) . * Choose a suitable RL algorithm based on the characteristics of the problem you want to solve (currently, QlibRL supports PPO and DQN algorithms based on tianshou). * Design the MDP (Markov Decision Process) process based on market trading rules and the problem you want to solve. Refer to the example in order execution and make corresponding modifications to the following modules: [State](https://github.com/microsoft/qlib/blob/main/qlib/rl/order_execution/state.py#L70) , [Metrics](https://github.com/microsoft/qlib/blob/main/qlib/rl/order_execution/state.py#L18) , [ActionInterpreter](https://github.com/microsoft/qlib/blob/main/qlib/rl/order_execution/interpreter.py#L199) , [StateInterpreter](https://github.com/microsoft/qlib/blob/main/qlib/rl/order_execution/interpreter.py#L68) , [Reward](https://github.com/microsoft/qlib/blob/main/qlib/rl/order_execution/reward.py) , [Observation](https://github.com/microsoft/qlib/blob/main/qlib/rl/order_execution/interpreter.py#L44) , [Simulator](https://github.com/microsoft/qlib/blob/main/qlib/rl/order_execution/simulator_simple.py) . --- # Reinforcement Learning in Quantitative Trading — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * [Reinforcement Learning in Quantitative Trading](https://qlib.readthedocs.io/en/latest/component/rl/toctree.html) * Reinforcement Learning in Quantitative Trading * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/rl/overall.rst.txt) * * * Reinforcement Learning in Quantitative Trading[](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#reinforcement-learning-in-quantitative-trading "Permalink to this heading") ============================================================================================================================================================================================== Reinforcement Learning[](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#reinforcement-learning "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------- Different from supervised learning tasks such as classification tasks and regression tasks. Another important paradigm in machine learning is Reinforcement Learning(RL), which attempts to optimize an accumulative numerical reward signal by directly interacting with the environment under a few assumptions such as Markov Decision Process(MDP). As demonstrated in the following figure, an RL system consists of four elements, 1)the agent 2) the environment the agent interacts with 3) the policy that the agent follows to take actions on the environment and 4)the reward signal from the environment to the agent. In general, the agent can perceive and interpret its environment, take actions and learn through reward, to seek long-term and maximum overall reward to achieve an optimal solution. [![../../_images/RL_framework.png](https://qlib.readthedocs.io/en/latest/_images/RL_framework.png)](https://qlib.readthedocs.io/en/latest/_images/RL_framework.png) RL attempts to learn to produce actions by trial and error. By sampling actions and then observing which one leads to our desired outcome, a policy is obtained to generate optimal actions. In contrast to supervised learning, RL learns this not from a label but from a time-delayed label called a reward. This scalar value lets us know whether the current outcome is good or bad. In a word, the target of RL is to take actions to maximize reward. The Qlib Reinforcement Learning toolkit (QlibRL) is an RL platform for quantitative investment, which provides support to implement the RL algorithms in Qlib. Potential Application Scenarios in Quantitative Trading[](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- RL methods have demonstrated remarkable achievements in various applications, including game playing, resource allocation, recommendation systems, marketing, and advertising. In the context of investment, which involves continuous decision-making, let’s consider the example of the stock market. Investors strive to optimize their investment returns by effectively managing their positions and stock holdings through various buying and selling behaviors. Furthermore, investors carefully evaluate market conditions and stock-specific information before making each buying or selling decision. From an investor’s perspective, this process can be viewed as a continuous decision-making process driven by interactions with the market. RL algorithms offer a promising approach to tackle such challenges. Here are several scenarios where RL holds potential for application in quantitative investment. ### Order Execution[](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#order-execution "Permalink to this heading") The order execution task is to execute orders efficiently while considering multiple factors, including optimal prices, minimizing trading costs, reducing market impact, maximizing order fullfill rates, and achieving execution within a specified time frame. RL can be applied to such tasks by incorporating these objectives into the reward function and action selection process. Specifically, the RL agent interacts with the market environment, observes the state from market information, and makes decisions on next step execution. The RL algorithm learns an optimal execution strategy through trial and error, aiming to maximize the expected cumulative reward, which incorporates the desired objectives. > * General Setting > > * Environment: The environment represents the financial market where order execution takes place. It encompasses variables such as the order book dynamics, liquidity, price movements, and market conditions. > > * State: The state refers to the information available to the RL agent at a given time step. It typically includes features such as the current order book state (bid-ask spread, order depth), historical price data, historical trading volume, market volatility, and any other relevant information that can aid in decision-making. > > * Action: The action is the decision made by the RL agent based on the observed state. In order execution, actions can include selecting the order size, price, and timing of execution. > > * Reward: The reward is a scalar signal that indicates the performance of the RL agent’s action in the environment. The reward function is designed to encourage actions that lead to efficient and cost-effective order execution. It typically considers multiple objectives, such as maximizing price advantages, minimizing trading costs (including transaction fees and slippage), reducing market impact (the effect of the order on the market price) and maximizing order fullfill rates. > > > * Scenarios > > * Single-asset order execution: Single-asset order execution focuses on the task of executing a single order for a specific asset, such as a stock or a cryptocurrency. The primary objective is to execute the order efficiently while considering factors such as maximizing price advantages, minimizing trading costs, reducing market impact, and achieving a high fullfill rate. The RL agent interacts with the market environment and makes decisions on order size, price, and timing of execution for that particular asset. The goal is to learn an optimal execution strategy for the single asset, maximizing the expected cumulative reward while considering the specific dynamics and characteristics of that asset. > > * Multi-asset order execution: Multi-asset order execution expands the order execution task to involve multiple assets or securities. It typically involves executing a portfolio of orders across different assets simultaneously or sequentially. Unlike single-asset order execution, the focus is not only on the execution of individual orders but also on managing the interactions and dependencies between different assets within the portfolio. The RL agent needs to make decisions on the order sizes, prices, and timings for each asset in the portfolio, considering their interdependencies, cash constraints, market conditions, and transaction costs. The goal is to learn an optimal execution strategy that balances the execution efficiency for each asset while considering the overall performance and objectives of the portfolio as a whole. > > The choice of settings and RL algorithm depends on the specific requirements of the task, available data, and desired performance objectives. ### Portfolio Construction[](https://qlib.readthedocs.io/en/latest/component/rl/overall.html#portfolio-construction "Permalink to this heading") Portfolio construction is a process of selecting and allocating assets in an investment portfolio. RL provides a framework to optimize portfolio management decisions by learning from interactions with the market environment and maximizing long-term returns while considering risk management. * General Setting * State: The state represents the current information about the market and the portfolio. It typically includes historical prices and volumes, technical indicators, and other relevant data. * Action: The action corresponds to the decision of allocating capital to different assets in the portfolio. It determines the weights or proportions of investments in each asset. * Reward: The reward is a metric that evaluates the performance of the portfolio. It can be defined in various ways, such as total return, risk-adjusted return, or other objectives like maximizing Sharpe ratio or minimizing drawdown. * Scenarios * Stock market: RL can be used to construct portfolios of stocks, where the agent learns to allocate capital among different stocks. * Cryptocurrency market: RL can be applied to construct portfolios of cryptocurrencies, where the agent learns to make allocation decisions. * Foreign exchange (Forex) market: RL can be used to construct portfolios of currency pairs, where the agent learns to allocate capital across different currencies based on exchange rate data, economic indicators, and other factors. Similarly, the choice of basic setting and algorithm depends on the specific requirements of the problem and the characteristics of the market. --- # Workflow: Workflow Management — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Workflow: Workflow Management * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/workflow.rst.txt) * * * Workflow: Workflow Management[](https://qlib.readthedocs.io/en/latest/component/workflow.html#workflow-workflow-management "Permalink to this heading") ========================================================================================================================================================= Introduction[](https://qlib.readthedocs.io/en/latest/component/workflow.html#introduction "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------ The components in [Qlib Framework](https://qlib.readthedocs.io/en/latest/introduction/introduction.html#framework) are designed in a loosely-coupled way. Users could build their own Quant research workflow with these components like [Example](https://github.com/microsoft/qlib/blob/main/examples/workflow_by_code.py) . Besides, `Qlib` provides more user-friendly interfaces named `qrun` to automatically run the whole workflow defined by configuration. Running the whole workflow is called an execution. With `qrun`, user can easily start an execution, which includes the following steps: * Data * Loading * Processing * Slicing * Model * Training and inference * Saving & loading * Evaluation * Forecast signal analysis * Backtest For each execution, `Qlib` has a complete system to tracking all the information as well as artifacts generated during training, inference and evaluation phase. For more information about how `Qlib` handles this, please refer to the related document: [Recorder: Experiment Management](https://qlib.readthedocs.io/en/latest/component/recorder.html) . Complete Example[](https://qlib.readthedocs.io/en/latest/component/workflow.html#complete-example "Permalink to this heading") -------------------------------------------------------------------------------------------------------------------------------- Before getting into details, here is a complete example of `qrun`, which defines the workflow in typical Quant research. Below is a typical config file of `qrun`. qlib\_init: provider\_uri: "~/.qlib/qlib\_data/cn\_data" region: cn market: &market csi300 benchmark: &benchmark SH000300 data\_handler\_config: &data\_handler\_config start\_time: 2008-01-01 end\_time: 2020-08-01 fit\_start\_time: 2008-01-01 fit\_end\_time: 2014-12-31 instruments: \*market port\_analysis\_config: &port\_analysis\_config strategy: class: TopkDropoutStrategy module\_path: qlib.contrib.strategy.strategy kwargs: topk: 50 n\_drop: 5 signal: backtest: start\_time: 2017-01-01 end\_time: 2020-08-01 account: 100000000 benchmark: \*benchmark exchange\_kwargs: limit\_threshold: 0.095 deal\_price: close open\_cost: 0.0005 close\_cost: 0.0015 min\_cost: 5 task: model: class: LGBModel module\_path: qlib.contrib.model.gbdt kwargs: loss: mse colsample\_bytree: 0.8879 learning\_rate: 0.0421 subsample: 0.8789 lambda\_l1: 205.6999 lambda\_l2: 580.9768 max\_depth: 8 num\_leaves: 210 num\_threads: 20 dataset: class: DatasetH module\_path: qlib.data.dataset kwargs: handler: class: Alpha158 module\_path: qlib.contrib.data.handler kwargs: \*data\_handler\_config segments: train: \[2008-01-01, 2014-12-31\] valid: \[2015-01-01, 2016-12-31\] test: \[2017-01-01, 2020-08-01\] record: \- class: SignalRecord module\_path: qlib.workflow.record\_temp kwargs: {} \- class: PortAnaRecord module\_path: qlib.workflow.record\_temp kwargs: config: \*port\_analysis\_config After saving the config into configuration.yaml, users could start the workflow and test their ideas with a single command below. qrun configuration.yaml If users want to use `qrun` under debug mode, please use the following command: python \-m pdb qlib/cli/run.py examples/benchmarks/LightGBM/workflow\_config\_lightgbm\_Alpha158.yaml Note qrun will be placed in your $PATH directory when installing `Qlib`. Note The symbol & in yaml file stands for an anchor of a field, which is useful when another fields include this parameter as part of the value. Taking the configuration file above as an example, users can directly change the value of market and benchmark without traversing the entire configuration file. Configuration File[](https://qlib.readthedocs.io/en/latest/component/workflow.html#configuration-file "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------------------ Let’s get into details of `qrun` in this section. Before using `qrun`, users need to prepare a configuration file. The following content shows how to prepare each part of the configuration file. The design logic of the configuration file is very simple. It predefines fixed workflows and provide this yaml interface to users to define how to initialize each component. It follow the design of [init\_instance\_by\_config](https://github.com/microsoft/qlib/blob/2aee9e0145decc3e71def70909639b5e5a6f4b58/qlib/utils/__init__.py#L264) . It defines the initialization of each component of Qlib, which typically include the class and the initialization arguments. For example, the following yaml and code are equivalent. model: class: LGBModel module\_path: qlib.contrib.model.gbdt kwargs: loss: mse colsample\_bytree: 0.8879 learning\_rate: 0.0421 subsample: 0.8789 lambda\_l1: 205.6999 lambda\_l2: 580.9768 max\_depth: 8 num\_leaves: 210 num\_threads: 20 from qlib.contrib.model.gbdt import LGBModel kwargs \= { "loss": "mse" , "colsample\_bytree": 0.8879, "learning\_rate": 0.0421, "subsample": 0.8789, "lambda\_l1": 205.6999, "lambda\_l2": 580.9768, "max\_depth": 8, "num\_leaves": 210, "num\_threads": 20, } LGBModel(kwargs) ### Qlib Init Section[](https://qlib.readthedocs.io/en/latest/component/workflow.html#qlib-init-section "Permalink to this heading") At first, the configuration file needs to contain several basic parameters which will be used for qlib initialization. provider\_uri: "~/.qlib/qlib\_data/cn\_data" region: cn The meaning of each field is as follows: * provider\_uri Type: str. The URI of the Qlib data. For example, it could be the location where the data loaded by `get_data.py` are stored. * region * If region == “us”, `Qlib` will be initialized in US-stock mode. * If region == “cn”, `Qlib` will be initialized in China-stock mode. Note The value of region should be aligned with the data stored in provider\_uri. ### Task Section[](https://qlib.readthedocs.io/en/latest/component/workflow.html#task-section "Permalink to this heading") The task field in the configuration corresponds to a task, which contains the parameters of three different subsections: Model, Dataset and Record. #### Model Section[](https://qlib.readthedocs.io/en/latest/component/workflow.html#model-section "Permalink to this heading") In the task field, the model section describes the parameters of the model to be used for training and inference. For more information about the base `Model` class, please refer to [Qlib Model](https://qlib.readthedocs.io/en/latest/component/model.html) . model: class: LGBModel module\_path: qlib.contrib.model.gbdt kwargs: loss: mse colsample\_bytree: 0.8879 learning\_rate: 0.0421 subsample: 0.8789 lambda\_l1: 205.6999 lambda\_l2: 580.9768 max\_depth: 8 num\_leaves: 210 num\_threads: 20 The meaning of each field is as follows: * class Type: str. The name for the model class. * module\_path Type: str. The path for the model in qlib. * kwargs The keywords arguments for the model. Please refer to the specific model implementation for more information: [models](https://github.com/microsoft/qlib/blob/main/qlib/contrib/model) . Note `Qlib` provides a util named: `init_instance_by_config` to initialize any class inside `Qlib` with the configuration includes the fields: class, module\_path and kwargs. #### Dataset Section[](https://qlib.readthedocs.io/en/latest/component/workflow.html#dataset-section "Permalink to this heading") The dataset field describes the parameters for the `Dataset` module in `Qlib` as well those for the module `DataHandler`. For more information about the `Dataset` module, please refer to [Qlib Data](https://qlib.readthedocs.io/en/latest/component/data.html#dataset) . The keywords arguments configuration of the `DataHandler` is as follows: data\_handler\_config: &data\_handler\_config start\_time: 2008-01-01 end\_time: 2020-08-01 fit\_start\_time: 2008-01-01 fit\_end\_time: 2014-12-31 instruments: \*market Users can refer to the document of [DataHandler](https://qlib.readthedocs.io/en/latest/component/data.html#datahandler) for more information about the meaning of each field in the configuration. Here is the configuration for the `Dataset` module which will take care of data preprocessing and slicing during the training and testing phase. dataset: class: DatasetH module\_path: qlib.data.dataset kwargs: handler: class: Alpha158 module\_path: qlib.contrib.data.handler kwargs: \*data\_handler\_config segments: train: \[2008-01-01, 2014-12-31\] valid: \[2015-01-01, 2016-12-31\] test: \[2017-01-01, 2020-08-01\] #### Record Section[](https://qlib.readthedocs.io/en/latest/component/workflow.html#record-section "Permalink to this heading") The record field is about the parameters the `Record` module in `Qlib`. `Record` is responsible for tracking training process and results such as information Coefficient (IC) and backtest in a standard format. The following script is the configuration of backtest and the strategy used in backtest: port\_analysis\_config: &port\_analysis\_config strategy: class: TopkDropoutStrategy module\_path: qlib.contrib.strategy.strategy kwargs: topk: 50 n\_drop: 5 signal: backtest: limit\_threshold: 0.095 account: 100000000 benchmark: \*benchmark deal\_price: close open\_cost: 0.0005 close\_cost: 0.0015 min\_cost: 5 For more information about the meaning of each field in configuration of strategy and backtest, users can look up the documents: [Strategy](https://qlib.readthedocs.io/en/latest/component/strategy.html) and [Backtest](https://qlib.readthedocs.io/en/latest/component/backtest.html) . Here is the configuration details of different Record Template such as `SignalRecord` and `PortAnaRecord`: record: \- class: SignalRecord module\_path: qlib.workflow.record\_temp kwargs: {} \- class: PortAnaRecord module\_path: qlib.workflow.record\_temp kwargs: config: \*port\_analysis\_config For more information about the `Record` module in `Qlib`, user can refer to the related document: [Record](https://qlib.readthedocs.io/en/latest/component/recorder.html#record-template) . --- # The Framework of QlibRL — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * [Reinforcement Learning in Quantitative Trading](https://qlib.readthedocs.io/en/latest/component/rl/toctree.html) * The Framework of QlibRL * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/rl/framework.rst.txt) * * * The Framework of QlibRL[](https://qlib.readthedocs.io/en/latest/component/rl/framework.html#the-framework-of-qlibrl "Permalink to this heading") ================================================================================================================================================== QlibRL contains a full set of components that cover the entire lifecycle of an RL pipeline, including building the simulator of the market, shaping states & actions, training policies (strategies), and backtesting strategies in the simulated environment. QlibRL is basically implemented with the support of Tianshou and Gym frameworks. The high-level structure of QlibRL is demonstrated below: [![../../_images/QlibRL_framework.png](https://qlib.readthedocs.io/en/latest/_images/QlibRL_framework.png)](https://qlib.readthedocs.io/en/latest/_images/QlibRL_framework.png) Here, we briefly introduce each component in the figure. EnvWrapper[](https://qlib.readthedocs.io/en/latest/component/rl/framework.html#envwrapper "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------ EnvWrapper is the complete capsulation of the simulated environment. It receives actions from outside (policy/strategy/agent), simulates the changes in the market, and then replies rewards and updated states, thus forming an interaction loop. In QlibRL, EnvWrapper is a subclass of gym.Env, so it implements all necessary interfaces of gym.Env. Any classes or pipelines that accept gym.Env should also accept EnvWrapper. Developers do not need to implement their own EnvWrapper to build their own environment. Instead, they only need to implement 4 components of the EnvWrapper: * Simulator The simulator is the core component responsible for the environment simulation. Developers could implement all the logic that is directly related to the environment simulation in the Simulator in any way they like. In QlibRL, there are already two implementations of Simulator for single asset trading: 1) `SingleAssetOrderExecution`, which is built based on Qlib’s backtest toolkits and hence considers a lot of practical trading details but is slow. 2) `SimpleSingleAssetOrderExecution`, which is built based on a simplified trading simulator, which ignores a lot of details (e.g. trading limitations, rounding) but is quite fast. * State interpreter The state interpreter is responsible for “interpret” states in the original format (format provided by the simulator) into states in a format that the policy could understand. For example, transform unstructured raw features into numerical tensors. * Action interpreter The action interpreter is similar to the state interpreter. But instead of states, it interprets actions generated by the policy, from the format provided by the policy to the format that is acceptable to the simulator. * Reward function The reward function returns a numerical reward to the policy after each time the policy takes an action. EnvWrapper will organically organize these components. Such decomposition allows for better flexibility in development. For example, if the developers want to train multiple types of policies in the same environment, they only need to design one simulator and design different state interpreters/action interpreters/reward functions for different types of policies. QlibRL has well-defined base classes for all these 4 components. All the developers need to do is define their own components by inheriting the base classes and then implementing all interfaces required by the base classes. The API for the above base components can be found [here](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.rl) . Policy[](https://qlib.readthedocs.io/en/latest/component/rl/framework.html#policy "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------- QlibRL directly uses Tianshou’s policy. Developers could use policies provided by Tianshou off the shelf, or implement their own policies by inheriting Tianshou’s policies. Training Vessel & Trainer[](https://qlib.readthedocs.io/en/latest/component/rl/framework.html#training-vessel-trainer "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------- As stated by their names, training vessels and trainers are helper classes used in training. A training vessel is a ship that contains a simulator/interpreters/reward function/policy, and it controls algorithm-related parts of training. Correspondingly, the trainer is responsible for controlling the runtime parts of training. As you may have noticed, a training vessel itself holds all the required components to build an EnvWrapper rather than holding an instance of EnvWrapper directly. This allows the training vessel to create duplicates of EnvWrapper dynamically when necessary (for example, under parallel training). With a training vessel, the trainer could finally launch the training pipeline by simple, Scikit-learn-like interfaces (i.e., `trainer.fit()`). The API for Trainer and TrainingVessel and can be found [here](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.rl.trainer) . The RL module is designed in a loosely-coupled way. Currently, RL examples are integrated with concrete business logic. But the core part of RL is much simpler than what you see. To demonstrate the simple core of RL, [a dedicated notebook](https://github.com/microsoft/qlib/tree/main/examples/rl/simple_example.ipynb) for RL without business loss is created. --- # Forecast Model: Model Training & Prediction — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Forecast Model: Model Training & Prediction * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/model.rst.txt) * * * Forecast Model: Model Training & Prediction[](https://qlib.readthedocs.io/en/latest/component/model.html#forecast-model-model-training-prediction "Permalink to this heading") ================================================================================================================================================================================ Introduction[](https://qlib.readthedocs.io/en/latest/component/model.html#introduction "Permalink to this heading") --------------------------------------------------------------------------------------------------------------------- `Forecast Model` is designed to make the prediction score about stocks. Users can use the `Forecast Model` in an automatic workflow by `qrun`, please refer to [Workflow: Workflow Management](https://qlib.readthedocs.io/en/latest/component/workflow.html) . Because the components in `Qlib` are designed in a loosely-coupled way, `Forecast Model` can be used as an independent module also. Base Class & Interface[](https://qlib.readthedocs.io/en/latest/component/model.html#base-class-interface "Permalink to this heading") --------------------------------------------------------------------------------------------------------------------------------------- `Qlib` provides a base class [qlib.model.base.Model](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.base) from which all models should inherit. The base class provides the following interfaces: _class_ qlib.model.base.Model Learnable Models fit(_dataset: Dataset_, _reweighter: Reweighter_) Learn model from the base model Note The attribute names of learned model should not start with ‘\_’. So that the model could be dumped to disk. The following code example shows how to retrieve x\_train, y\_train and w\_train from the dataset: > \# get features and labels > df\_train, df\_valid \= dataset.prepare( > \["train", "valid"\], col\_set\=\["feature", "label"\], data\_key\=DataHandlerLP.DK\_L > ) > x\_train, y\_train \= df\_train\["feature"\], df\_train\["label"\] > x\_valid, y\_valid \= df\_valid\["feature"\], df\_valid\["label"\] > > \# get weights > try: > wdf\_train, wdf\_valid \= dataset.prepare(\["train", "valid"\], col\_set\=\["weight"\], > data\_key\=DataHandlerLP.DK\_L) > w\_train, w\_valid \= wdf\_train\["weight"\], wdf\_valid\["weight"\] > except KeyError as e: > w\_train \= pd.DataFrame(np.ones\_like(y\_train.values), index\=y\_train.index) > w\_valid \= pd.DataFrame(np.ones\_like(y\_valid.values), index\=y\_valid.index) Parameters: **dataset** ([_Dataset_](https://qlib.readthedocs.io/en/latest/reference/api.html#qlib.data.dataset.__init__.Dataset "qlib.data.dataset.__init__.Dataset") ) – dataset will generate the processed data from model training. _abstract_ predict(_dataset: Dataset_, _segment: str | slice \= 'test'_) → object give prediction given Dataset Parameters: * **dataset** ([_Dataset_](https://qlib.readthedocs.io/en/latest/reference/api.html#qlib.data.dataset.__init__.Dataset "qlib.data.dataset.__init__.Dataset") ) – dataset will generate the processed dataset from model training. * **segment** (_Text_ _or_ _slice_) – dataset will use this segment to prepare data. (default=test) Return type: Prediction results with certain type such as pandas.Series. `Qlib` also provides a base class [qlib.model.base.ModelFT](https://qlib.readthedocs.io/en/latest/reference/api.html#qlib.model.base.ModelFT) , which includes the method for finetuning the model. For other interfaces such as finetune, please refer to [Model API](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.base) . Example[](https://qlib.readthedocs.io/en/latest/component/model.html#example "Permalink to this heading") ----------------------------------------------------------------------------------------------------------- `Qlib`’s Model Zoo includes models such as `LightGBM`, `MLP`, `LSTM`, etc.. These models are treated as the baselines of `Forecast Model`. The following steps show how to run\`\` LightGBM\`\` as an independent module. * Initialize `Qlib` with qlib.init first, please refer to [Initialization](https://qlib.readthedocs.io/en/latest/start/initialization.html) . * Run the following code to get the prediction score pred\_score from qlib.contrib.model.gbdt import LGBModel from qlib.contrib.data.handler import Alpha158 from qlib.utils import init\_instance\_by\_config, flatten\_dict from qlib.workflow import R from qlib.workflow.record\_temp import SignalRecord, PortAnaRecord market \= "csi300" benchmark \= "SH000300" data\_handler\_config \= { "start\_time": "2008-01-01", "end\_time": "2020-08-01", "fit\_start\_time": "2008-01-01", "fit\_end\_time": "2014-12-31", "instruments": market, } task \= { "model": { "class": "LGBModel", "module\_path": "qlib.contrib.model.gbdt", "kwargs": { "loss": "mse", "colsample\_bytree": 0.8879, "learning\_rate": 0.0421, "subsample": 0.8789, "lambda\_l1": 205.6999, "lambda\_l2": 580.9768, "max\_depth": 8, "num\_leaves": 210, "num\_threads": 20, }, }, "dataset": { "class": "DatasetH", "module\_path": "qlib.data.dataset", "kwargs": { "handler": { "class": "Alpha158", "module\_path": "qlib.contrib.data.handler", "kwargs": data\_handler\_config, }, "segments": { "train": ("2008-01-01", "2014-12-31"), "valid": ("2015-01-01", "2016-12-31"), "test": ("2017-01-01", "2020-08-01"), }, }, }, } \# model initialization model \= init\_instance\_by\_config(task\["model"\]) dataset \= init\_instance\_by\_config(task\["dataset"\]) \# start exp with R.start(experiment\_name\="workflow"): \# train R.log\_params(\*\*flatten\_dict(task)) model.fit(dataset) \# prediction recorder \= R.get\_recorder() sr \= SignalRecord(model, dataset, recorder) sr.generate() Note Alpha158 is the data handler provided by `Qlib`, please refer to [Data Handler](https://qlib.readthedocs.io/en/latest/component/data.html#data-handler) . SignalRecord is the Record Template in `Qlib`, please refer to [Workflow](https://qlib.readthedocs.io/en/latest/component/recorder.html#record-template) . Also, the above example has been given in `examples/train_backtest_analyze.ipynb`. Technically, the meaning of the model prediction depends on the label setting designed by user. By default, the meaning of the score is normally the rating of the instruments by the forecasting model. The higher the score, the more profit the instruments. Custom Model[](https://qlib.readthedocs.io/en/latest/component/model.html#custom-model "Permalink to this heading") --------------------------------------------------------------------------------------------------------------------- Qlib supports custom models. If users are interested in customizing their own models and integrating the models into `Qlib`, please refer to [Custom Model Integration](https://qlib.readthedocs.io/en/latest/start/integration.html) . API[](https://qlib.readthedocs.io/en/latest/component/model.html#api "Permalink to this heading") --------------------------------------------------------------------------------------------------- Please refer to [Model API](https://qlib.readthedocs.io/en/latest/reference/api.html#module-qlib.model.base) . --- # Quick Start — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * [Reinforcement Learning in Quantitative Trading](https://qlib.readthedocs.io/en/latest/component/rl/toctree.html) * Quick Start * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/rl/quickstart.rst.txt) * * * Quick Start[](https://qlib.readthedocs.io/en/latest/component/rl/quickstart.html#quick-start "Permalink to this heading") =========================================================================================================================== QlibRL provides an example of an implementation of a single asset order execution task and the following is an example of the config file to train with QlibRL. simulator: \# Each step contains 30mins time\_per\_step: 30 \# Upper bound of volume, should be null or a float between 0 and 1, if it is a float, represent upper bound is calculated by the percentage of the market volume vol\_limit: null env: \# Concurrent environment workers. concurrency: 1 \# dummy or subproc or shmem. Corresponding to \`parallelism in tianshou \`\_. parallel\_mode: dummy action\_interpreter: class: CategoricalActionInterpreter kwargs: \# Candidate actions, it can be a list with length L: \[a\_1, a\_2,..., a\_L\] or an integer n, in which case the list of length n+1 is auto-generated, i.e., \[0, 1/n, 2/n,..., n/n\]. values: 14 \# Total number of steps (an upper-bound estimation) max\_step: 8 module\_path: qlib.rl.order\_execution.interpreter state\_interpreter: class: FullHistoryStateInterpreter kwargs: \# Number of dimensions in data. data\_dim: 6 \# Equal to the total number of records. For example, in SAOE per minute, data\_ticks is the length of the day in minutes. data\_ticks: 240 \# The total number of steps (an upper-bound estimation). For example, 390min / 30min-per-step = 13 steps. max\_step: 8 \# Provider of the processed data. processed\_data\_provider: class: PickleProcessedDataProvider module\_path: qlib.rl.data.pickle\_styled kwargs: data\_dir: ./data/pickle\_dataframe/feature module\_path: qlib.rl.order\_execution.interpreter reward: class: PAPenaltyReward kwargs: \# The penalty for a large volume in a short time. penalty: 100.0 module\_path: qlib.rl.order\_execution.reward data: source: order\_dir: ./data/training\_order\_split data\_dir: ./data/pickle\_dataframe/backtest \# number of time indexes total\_time: 240 \# start time index default\_start\_time: 0 \# end time index default\_end\_time: 240 proc\_data\_dim: 6 num\_workers: 0 queue\_size: 20 network: class: Recurrent module\_path: qlib.rl.order\_execution.network policy: class: PPO kwargs: lr: 0.0001 module\_path: qlib.rl.order\_execution.policy runtime: seed: 42 use\_cuda: false trainer: max\_epoch: 2 \# Number of episodes collected in each training iteration repeat\_per\_collect: 5 earlystop\_patience: 2 \# Episodes per collect at training. episode\_per\_collect: 20 batch\_size: 16 \# Perform validation every n iterations val\_every\_n\_epoch: 1 checkpoint\_path: ./checkpoints checkpoint\_every\_n\_iters: 1 And the config file for backtesting: order\_file: ./data/backtest\_orders.csv start\_time: "9:45" end\_time: "14:44" qlib: provider\_uri\_1min: ./data/bin feature\_root\_dir: ./data/pickle \# feature generated by today's information feature\_columns\_today: \[\ "$open", "$high", "$low", "$close", "$vwap", "$volume",\ \] \# feature generated by yesterday's information feature\_columns\_yesterday: \[\ "$open\_v1", "$high\_v1", "$low\_v1", "$close\_v1", "$vwap\_v1", "$volume\_v1",\ \] exchange: \# the expression for buying and selling stock limitation limit\_threshold: \['$close \== 0', '$close \== 0'\] \# deal price for buying and selling deal\_price: \["If($close \== 0, $vwap, $close)", "If($close \== 0, $vwap, $close)"\] volume\_threshold: \# volume limits are both buying and selling, "cum" means that this is a cumulative value over time all: \["cum", "0.2 \* DayCumsum($volume, '9:45', '14:44')"\] \# the volume limits of buying buy: \["current", "$close"\] \# the volume limits of selling, "current" means that this is a real-time value and will not accumulate over time sell: \["current", "$close"\] strategies: 30min: class: TWAPStrategy module\_path: qlib.contrib.strategy.rule\_strategy kwargs: {} 1day: class: SAOEIntStrategy module\_path: qlib.rl.order\_execution.strategy kwargs: state\_interpreter: class: FullHistoryStateInterpreter module\_path: qlib.rl.order\_execution.interpreter kwargs: max\_step: 8 data\_ticks: 240 data\_dim: 6 processed\_data\_provider: class: PickleProcessedDataProvider module\_path: qlib.rl.data.pickle\_styled kwargs: data\_dir: ./data/pickle\_dataframe/feature action\_interpreter: class: CategoricalActionInterpreter module\_path: qlib.rl.order\_execution.interpreter kwargs: values: 14 max\_step: 8 network: class: Recurrent module\_path: qlib.rl.order\_execution.network kwargs: {} policy: class: PPO module\_path: qlib.rl.order\_execution.policy kwargs: lr: 1.0e-4 \# Local path to the latest model. The model is generated during training, so please run training first if you want to run backtest with a trained policy. You could also remove this parameter file to run backtest with a randomly initialized policy. weight\_file: ./checkpoints/latest.pth \# Concurrent environment workers. concurrency: 5 With the above config files, you can start training the agent by the following command: $ python \-m qlib.rl.contrib.train\_onpolicy.py \--config\_path train\_config.yml After the training, you can backtest with the following command: $ python \-m qlib.rl.contrib.backtest.py \--config\_path backtest\_config.yml In that case, `SingleAssetOrderExecution` and [`SingleAssetOrderExecutionSimple`](https://qlib.readthedocs.io/en/latest/reference/api.html#qlib.rl.order_execution.SingleAssetOrderExecutionSimple "qlib.rl.order_execution.simulator_simple.SingleAssetOrderExecutionSimple") as examples for simulator, [`qlib.rl.order_execution.interpreter.FullHistoryStateInterpreter`](https://qlib.readthedocs.io/en/latest/reference/api.html#qlib.rl.order_execution.FullHistoryStateInterpreter "qlib.rl.order_execution.interpreter.FullHistoryStateInterpreter") and [`qlib.rl.order_execution.interpreter.CategoricalActionInterpreter`](https://qlib.readthedocs.io/en/latest/reference/api.html#qlib.rl.order_execution.CategoricalActionInterpreter "qlib.rl.order_execution.interpreter.CategoricalActionInterpreter") as examples for interpreter, [`qlib.rl.order_execution.policy.PPO`](https://qlib.readthedocs.io/en/latest/reference/api.html#qlib.rl.order_execution.PPO "qlib.rl.order_execution.policy.PPO") as an example for policy, and [`qlib.rl.order_execution.reward.PAPenaltyReward`](https://qlib.readthedocs.io/en/latest/reference/api.html#qlib.rl.order_execution.PAPenaltyReward "qlib.rl.order_execution.reward.PAPenaltyReward") as an example for reward. For the single asset order execution task, if developers have already defined their simulator/interpreters/reward function/policy, they could launch the training and backtest pipeline by simply modifying the corresponding settings in the config files. The details about the example can be found [here](https://github.com/microsoft/qlib/blob/main/examples/rl/README.md) . In the future, we will provide more examples for different scenarios such as RL-based portfolio construction. --- # Portfolio Strategy: Portfolio Management — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Portfolio Strategy: Portfolio Management * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/strategy.rst.txt) * * * Portfolio Strategy: Portfolio Management[](https://qlib.readthedocs.io/en/latest/component/strategy.html#portfolio-strategy-portfolio-management "Permalink to this heading") =============================================================================================================================================================================== Introduction[](https://qlib.readthedocs.io/en/latest/component/strategy.html#introduction "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------ `Portfolio Strategy` is designed to adopt different portfolio strategies, which means that users can adopt different algorithms to generate investment portfolios based on the prediction scores of the `Forecast Model`. Users can use the `Portfolio Strategy` in an automatic workflow by `Workflow` module, please refer to [Workflow: Workflow Management](https://qlib.readthedocs.io/en/latest/component/workflow.html) . Because the components in `Qlib` are designed in a loosely-coupled way, `Portfolio Strategy` can be used as an independent module also. `Qlib` provides several implemented portfolio strategies. Also, `Qlib` supports custom strategy, users can customize strategies according to their own requirements. After users specifying the models(forecasting signals) and strategies, running backtest will help users to check the performance of a custom model(forecasting signals)/strategy. Base Class & Interface[](https://qlib.readthedocs.io/en/latest/component/strategy.html#base-class-interface "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------------------------ ### BaseStrategy[](https://qlib.readthedocs.io/en/latest/component/strategy.html#basestrategy "Permalink to this heading") Qlib provides a base class `qlib.strategy.base.BaseStrategy`. All strategy classes need to inherit the base class and implement its interface. * generate\_trade\_decision generate\_trade\_decision is a key interface that generates trade decisions in each trading bar. The frequency to call this method depends on the executor frequency(“time\_per\_step”=”day” by default). But the trading frequency can be decided by users’ implementation. For example, if the user wants to trading in weekly while the time\_per\_step is “day” in executor, user can return non-empty TradeDecision weekly(otherwise return empty like [this](https://github.com/microsoft/qlib/blob/main/qlib/contrib/strategy/signal_strategy.py#L132) ). Users can inherit BaseStrategy to customize their strategy class. ### WeightStrategyBase[](https://qlib.readthedocs.io/en/latest/component/strategy.html#weightstrategybase "Permalink to this heading") Qlib also provides a class `qlib.contrib.strategy.WeightStrategyBase` that is a subclass of BaseStrategy. WeightStrategyBase only focuses on the target positions, and automatically generates an order list based on positions. It provides the generate\_target\_weight\_position interface. * generate\_target\_weight\_position * According to the current position and trading date to generate the target position. The cash is not considered in the output weight distribution. * Return the target position. Note Here the target position means the target percentage of total assets. WeightStrategyBase implements the interface generate\_order\_list, whose processions is as follows. * Call generate\_target\_weight\_position method to generate the target position. * Generate the target amount of stocks from the target position. * Generate the order list from the target amount Users can inherit WeightStrategyBase and implement the interface generate\_target\_weight\_position to customize their strategy class, which only focuses on the target positions. Implemented Strategy[](https://qlib.readthedocs.io/en/latest/component/strategy.html#implemented-strategy "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------------------------- Qlib provides a implemented strategy classes named TopkDropoutStrategy. ### TopkDropoutStrategy[](https://qlib.readthedocs.io/en/latest/component/strategy.html#topkdropoutstrategy "Permalink to this heading") TopkDropoutStrategy is a subclass of BaseStrategy and implement the interface generate\_order\_list whose process is as follows. * Adopt the `Topk-Drop` algorithm to calculate the target amount of each stock > Note > > There are two parameters for the `Topk-Drop` algorithm: > > * Topk: The number of stocks held > > * Drop: The number of stocks sold on each trading day > > > In general, the number of stocks currently held is Topk, with the exception of being zero at the beginning period of trading. For each trading day, let $d$ be the number of the instruments currently held and with a rank $gt K$ when ranked by the prediction scores from high to low. Then d number of stocks currently held with the worst prediction score will be sold, and the same number of unheld stocks with the best prediction score will be bought. > > In general, $d=$\`Drop\`, especially when the pool of the candidate instruments is large, $K$ is large, and Drop is small. > > In most cases, `TopkDrop` algorithm sells and buys Drop stocks every trading day, which yields a turnover rate of 2$times$\`Drop\`/$K$. > > The following images illustrate a typical scenario. > > ![Topk-Drop](https://qlib.readthedocs.io/en/latest/_images/topk_drop.png) * Generate the order list from the target amount ### EnhancedIndexingStrategy[](https://qlib.readthedocs.io/en/latest/component/strategy.html#enhancedindexingstrategy "Permalink to this heading") EnhancedIndexingStrategy Enhanced indexing combines the arts of active management and passive management, with the aim of outperforming a benchmark index (e.g., S&P 500) in terms of portfolio return while controlling the risk exposure (a.k.a. tracking error). For more information, please refer to qlib.contrib.strategy.signal\_strategy.EnhancedIndexingStrategy and qlib.contrib.strategy.optimizer.enhanced\_indexing.EnhancedIndexingOptimizer. Usage & Example[](https://qlib.readthedocs.io/en/latest/component/strategy.html#usage-example "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------------- First, user can create a model to get trading signals(the variable name is `pred_score` in following cases). ### Prediction Score[](https://qlib.readthedocs.io/en/latest/component/strategy.html#prediction-score "Permalink to this heading") The prediction score is a pandas DataFrame. Its index is and it must contains a score column. A prediction sample is shown as follows. datetime instrument score 2019\-01\-04 SH600000 \-0.505488 2019\-01\-04 SZ002531 \-0.320391 2019\-01\-04 SZ000999 0.583808 2019\-01\-04 SZ300569 0.819628 2019\-01\-04 SZ001696 \-0.137140 ... ... 2019\-04\-30 SZ000996 \-1.027618 2019\-04\-30 SH603127 0.225677 2019\-04\-30 SH603126 0.462443 2019\-04\-30 SH603133 \-0.302460 2019\-04\-30 SZ300760 \-0.126383 `Forecast Model` module can make predictions, please refer to [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/latest/component/model.html) . Normally, the prediction score is the output of the models. But some models are learned from a label with a different scale. So the scale of the prediction score may be different from your expectation(e.g. the return of instruments). Qlib didn’t add a step to scale the prediction score to a unified scale due to the following reasons. - Because not every trading strategy cares about the scale(e.g. TopkDropoutStrategy only cares about the order). So the strategy is responsible for rescaling the prediction score(e.g. some portfolio-optimization-based strategies may require a meaningful scale). - The model has the flexibility to define the target, loss, and data processing. So we don’t think there is a silver bullet to rescale it back directly barely based on the model’s outputs. If you want to scale it back to some meaningful values(e.g. stock returns.), an intuitive solution is to create a regression model for the model’s recent outputs and your recent target values. ### Running backtest[](https://qlib.readthedocs.io/en/latest/component/strategy.html#running-backtest "Permalink to this heading") * In most cases, users could backtest their portfolio management strategy with `backtest_daily`. > from pprint import pprint > > import qlib > import pandas as pd > from qlib.utils.time import Freq > from qlib.utils import flatten\_dict > from qlib.contrib.evaluate import backtest\_daily > from qlib.contrib.evaluate import risk\_analysis > from qlib.contrib.strategy import TopkDropoutStrategy > > \# init qlib > qlib.init(provider\_uri\=) > > CSI300\_BENCH \= "SH000300" > STRATEGY\_CONFIG \= { > "topk": 50, > "n\_drop": 5, > \# pred\_score, pd.Series > "signal": pred\_score, > } > > strategy\_obj \= TopkDropoutStrategy(\*\*STRATEGY\_CONFIG) > report\_normal, positions\_normal \= backtest\_daily( > start\_time\="2017-01-01", end\_time\="2020-08-01", strategy\=strategy\_obj > ) > analysis \= dict() > \# default frequency will be daily (i.e. "day") > analysis\["excess\_return\_without\_cost"\] \= risk\_analysis(report\_normal\["return"\] \- report\_normal\["bench"\]) > analysis\["excess\_return\_with\_cost"\] \= risk\_analysis(report\_normal\["return"\] \- report\_normal\["bench"\] \- report\_normal\["cost"\]) > > analysis\_df \= pd.concat(analysis) \# type: pd.DataFrame > pprint(analysis\_df) * If users would like to control their strategies in a more detailed(e.g. users have a more advanced version of executor), user could follow this example. > from pprint import pprint > > import qlib > import pandas as pd > from qlib.utils.time import Freq > from qlib.utils import flatten\_dict > from qlib.backtest import backtest, executor > from qlib.contrib.evaluate import risk\_analysis > from qlib.contrib.strategy import TopkDropoutStrategy > > \# init qlib > qlib.init(provider\_uri\=) > > CSI300\_BENCH \= "SH000300" > \# Benchmark is for calculating the excess return of your strategy. > \# Its data format will be like \*\*ONE normal instrument\*\*. > \# For example, you can query its data with the code below > \# \`D.features(\["SH000300"\], \["$close"\], start\_time='2010-01-01', end\_time='2017-12-31', freq='day')\` > \# It is different from the argument \`market\`, which indicates a universe of stocks (e.g. \*\*A SET\*\* of stocks like csi300) > \# For example, you can query all data from a stock market with the code below. > \# \` D.features(D.instruments(market='csi300'), \["$close"\], start\_time='2010-01-01', end\_time='2017-12-31', freq='day')\` > > FREQ \= "day" > STRATEGY\_CONFIG \= { > "topk": 50, > "n\_drop": 5, > \# pred\_score, pd.Series > "signal": pred\_score, > } > > EXECUTOR\_CONFIG \= { > "time\_per\_step": "day", > "generate\_portfolio\_metrics": True, > } > > backtest\_config \= { > "start\_time": "2017-01-01", > "end\_time": "2020-08-01", > "account": 100000000, > "benchmark": CSI300\_BENCH, > "exchange\_kwargs": { > "freq": FREQ, > "limit\_threshold": 0.095, > "deal\_price": "close", > "open\_cost": 0.0005, > "close\_cost": 0.0015, > "min\_cost": 5, > }, > } > > \# strategy object > strategy\_obj \= TopkDropoutStrategy(\*\*STRATEGY\_CONFIG) > \# executor object > executor\_obj \= executor.SimulatorExecutor(\*\*EXECUTOR\_CONFIG) > \# backtest > portfolio\_metric\_dict, indicator\_dict \= backtest(executor\=executor\_obj, strategy\=strategy\_obj, \*\*backtest\_config) > analysis\_freq \= "{0}{1}".format(\*Freq.parse(FREQ)) > \# backtest info > report\_normal, positions\_normal \= portfolio\_metric\_dict.get(analysis\_freq) > > \# analysis > analysis \= dict() > analysis\["excess\_return\_without\_cost"\] \= risk\_analysis( > report\_normal\["return"\] \- report\_normal\["bench"\], freq\=analysis\_freq > ) > analysis\["excess\_return\_with\_cost"\] \= risk\_analysis( > report\_normal\["return"\] \- report\_normal\["bench"\] \- report\_normal\["cost"\], freq\=analysis\_freq > ) > > analysis\_df \= pd.concat(analysis) \# type: pd.DataFrame > \# log metrics > analysis\_dict \= flatten\_dict(analysis\_df\["risk"\].unstack().T.to\_dict()) > \# print out results > pprint(f"The following are analysis results of benchmark return({analysis\_freq}).") > pprint(risk\_analysis(report\_normal\["bench"\], freq\=analysis\_freq)) > pprint(f"The following are analysis results of the excess return without cost({analysis\_freq}).") > pprint(analysis\["excess\_return\_without\_cost"\]) > pprint(f"The following are analysis results of the excess return with cost({analysis\_freq}).") > pprint(analysis\["excess\_return\_with\_cost"\]) ### Result[](https://qlib.readthedocs.io/en/latest/component/strategy.html#result "Permalink to this heading") The backtest results are in the following form: risk excess\_return\_without\_cost mean 0.000605 std 0.005481 annualized\_return 0.152373 information\_ratio 1.751319 max\_drawdown \-0.059055 excess\_return\_with\_cost mean 0.000410 std 0.005478 annualized\_return 0.103265 information\_ratio 1.187411 max\_drawdown \-0.075024 * excess\_return\_without\_cost * mean Mean value of the CAR (cumulative abnormal return) without cost * std The Standard Deviation of CAR (cumulative abnormal return) without cost. * annualized\_return The Annualized Rate of CAR (cumulative abnormal return) without cost. * information\_ratio The Information Ratio without cost. please refer to [Information Ratio – IR](https://www.investopedia.com/terms/i/informationratio.asp) . * max\_drawdown The Maximum Drawdown of CAR (cumulative abnormal return) without cost, please refer to [Maximum Drawdown (MDD)](https://www.investopedia.com/terms/m/maximum-drawdown-mdd.asp) . * excess\_return\_with\_cost * mean Mean value of the CAR (cumulative abnormal return) series with cost * std The Standard Deviation of CAR (cumulative abnormal return) series with cost. * annualized\_return The Annualized Rate of CAR (cumulative abnormal return) with cost. * information\_ratio The Information Ratio with cost. please refer to [Information Ratio – IR](https://www.investopedia.com/terms/i/informationratio.asp) . * max\_drawdown The Maximum Drawdown of CAR (cumulative abnormal return) with cost, please refer to [Maximum Drawdown (MDD)](https://www.investopedia.com/terms/m/maximum-drawdown-mdd.asp) . Reference[](https://qlib.readthedocs.io/en/latest/component/strategy.html#reference "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------ To know more about the prediction score pred\_score output by `Forecast Model`, please refer to [Forecast Model: Model Training & Prediction](https://qlib.readthedocs.io/en/latest/component/model.html) . --- # Reinforcement Learning in Quantitative Trading — QLib 0.9.7 documentation * [](https://qlib.readthedocs.io/en/v0.9.7/index.html) * Reinforcement Learning in Quantitative Trading * [View page source](https://qlib.readthedocs.io/en/v0.9.7/_sources/component/rl/toctree.rst.txt) * * * Reinforcement Learning in Quantitative Trading[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/toctree.html#reinforcement-learning-in-quantitative-trading "Permalink to this heading") ============================================================================================================================================================================================== * [Guidance](https://qlib.readthedocs.io/en/v0.9.7/component/rl/guidance.html) * [Beginners to Reinforcement Learning Algorithms](https://qlib.readthedocs.io/en/v0.9.7/component/rl/guidance.html#beginners-to-reinforcement-learning-algorithms) * [Reinforcement Learning Algorithm Researcher](https://qlib.readthedocs.io/en/v0.9.7/component/rl/guidance.html#reinforcement-learning-algorithm-researcher) * [Quantitative Researcher](https://qlib.readthedocs.io/en/v0.9.7/component/rl/guidance.html#quantitative-researcher) * [Overall](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Order Execution](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#order-execution) * [Portfolio Construction](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#portfolio-construction) * [Quick Start](https://qlib.readthedocs.io/en/v0.9.7/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html#training-vessel-trainer) --- # Meta Controller: Meta-Task & Meta-Dataset & Meta-Model — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Meta Controller: Meta-Task & Meta-Dataset & Meta-Model * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/meta.rst.txt) * * * Meta Controller: Meta-Task & Meta-Dataset & Meta-Model[](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-controller-meta-task-meta-dataset-meta-model "Permalink to this heading") =================================================================================================================================================================================================== Introduction[](https://qlib.readthedocs.io/en/latest/component/meta.html#introduction "Permalink to this heading") -------------------------------------------------------------------------------------------------------------------- `Meta Controller` provides guidance to `Forecast Model`, which aims to learn regular patterns among a series of forecasting tasks and use learned patterns to guide forthcoming forecasting tasks. Users can implement their own meta-model instance based on `Meta Controller` module. Meta Task[](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-task "Permalink to this heading") -------------------------------------------------------------------------------------------------------------- A Meta Task instance is the basic element in the meta-learning framework. It saves the data that can be used for the Meta Model. Multiple Meta Task instances may share the same Data Handler, controlled by Meta Dataset. Users should use prepare\_task\_data() to obtain the data that can be directly fed into the Meta Model. _class_ qlib.model.meta.task.MetaTask(_task: dict_, _meta\_info: object_, _mode: str \= 'full'_)[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.task.MetaTask "Permalink to this definition") A single meta-task, a meta-dataset contains a list of them. It serves as a component as in MetaDatasetDS The data processing is different * the processed input may be different between training and testing > * When training, the X, y, X\_test, y\_test in training tasks are necessary (# PROC\_MODE\_FULL #) but not necessary in test tasks. (# PROC\_MODE\_TEST #) > > * When the meta model can be transferred into other dataset, only meta\_info is necessary (# PROC\_MODE\_TRANSFER #) > \_\_init\_\_(_task: dict_, _meta\_info: object_, _mode: str \= 'full'_)[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.task.MetaTask.__init__ "Permalink to this definition") The \_\_init\_\_ func is responsible for * store the task * store the origin input data for * process the input data for meta data Parameters: * **task** (_dict_) – the task to be enhanced by meta model * **meta\_info** (_object_) – the input for meta model get\_meta\_input() → object[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.task.MetaTask.get_meta_input "Permalink to this definition") Return the **processed** meta\_info Meta Dataset[](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-dataset "Permalink to this heading") -------------------------------------------------------------------------------------------------------------------- Meta Dataset controls the meta-information generating process. It is on the duty of providing data for training the Meta Model. Users should use prepare\_tasks to retrieve a list of Meta Task instances. _class_ qlib.model.meta.dataset.MetaTaskDataset(_segments: Dict\[str, Tuple\] | float_, _\*args_, _\*\*kwargs_)[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.dataset.MetaTaskDataset "Permalink to this definition") A dataset fetching the data in a meta-level. A Meta Dataset is responsible for * input tasks(e.g. Qlib tasks) and prepare meta tasks > * meta task contains more information than normal tasks (e.g. input data for meta model) > The learnt pattern could transfer to other meta dataset. The following cases should be supported * A meta-model trained on meta-dataset A and then applied to meta-dataset B > * Some pattern are shared between meta-dataset A and B, so meta-input on meta-dataset A are used when meta model are applied on meta-dataset-B > \_\_init\_\_(_segments: Dict\[str, Tuple\] | float_, _\*args_, _\*\*kwargs_)[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.dataset.MetaTaskDataset.__init__ "Permalink to this definition") The meta-dataset maintains a list of meta-tasks when it is initialized. The segments indicates the way to divide the data The duty of the \_\_init\_\_ function of MetaTaskDataset - initialize the tasks prepare\_tasks(_segments: List\[str\] | str_, _\*args_, _\*\*kwargs_) → List\[[MetaTask](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.task.MetaTask "qlib.model.meta.task.MetaTask")\ \][](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.dataset.MetaTaskDataset.prepare_tasks "Permalink to this definition") Prepare the data in each meta-task and ready for training. The following code example shows how to retrieve a list of meta-tasks from the meta\_dataset: > \# get the train segment and the test segment, both of them are lists > train\_meta\_tasks, test\_meta\_tasks \= meta\_dataset.prepare\_tasks(\["train", "test"\]) Parameters: **segments** (_Union__\[__List__\[__Text__\]__,_ _Tuple__\[__Text__\]__,_ _Text__\]_) – the info to select data Returns: A list of the prepared data of each meta-task for training the meta-model. For multiple segments \[seg1, seg2, … , segN\], the returned list will be \[\[tasks in seg1\], \[tasks in seg2\], … , \[tasks in segN\]\]. Each task is a meta task Return type: list Meta Model[](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-model "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------- ### General Meta Model[](https://qlib.readthedocs.io/en/latest/component/meta.html#general-meta-model "Permalink to this heading") Meta Model instance is the part that controls the workflow. The usage of the Meta Model includes: 1. Users train their Meta Model with the fit function. 2. The Meta Model instance guides the workflow by giving useful information via the inference function. _class_ qlib.model.meta.model.MetaModel[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.model.MetaModel "Permalink to this definition") The meta-model guiding the model learning. The word Guiding can be categorized into two types based on the stage of model learning - The definition of learning tasks: Please refer to docs of MetaTaskModel - Controlling the learning process of models: Please refer to the docs of MetaGuideModel _abstract_ fit(_\*args_, _\*\*kwargs_)[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.model.MetaModel.fit "Permalink to this definition") The training process of the meta-model. _abstract_ inference(_\*args_, _\*\*kwargs_) → object[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.model.MetaModel.inference "Permalink to this definition") The inference process of the meta-model. Returns: Some information to guide the model learning Return type: object ### Meta Task Model[](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-task-model "Permalink to this heading") This type of meta-model may interact with task definitions directly. Then, the Meta Task Model is the class for them to inherit from. They guide the base tasks by modifying the base task definitions. The function prepare\_tasks can be used to obtain the modified base task definitions. _class_ qlib.model.meta.model.MetaTaskModel[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.model.MetaTaskModel "Permalink to this definition") This type of meta-model deals with base task definitions. The meta-model creates tasks for training new base forecasting models after it is trained. prepare\_tasks directly modifies the task definitions. fit(_meta\_dataset: [MetaTaskDataset](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.dataset.MetaTaskDataset "qlib.model.meta.dataset.MetaTaskDataset") _)[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.model.MetaTaskModel.fit "Permalink to this definition") The MetaTaskModel is expected to get prepared MetaTask from meta\_dataset. And then it will learn knowledge from the meta tasks inference(_meta\_dataset: [MetaTaskDataset](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.dataset.MetaTaskDataset "qlib.model.meta.dataset.MetaTaskDataset") _) → List\[dict\][](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.model.MetaTaskModel.inference "Permalink to this definition") MetaTaskModel will make inference on the meta\_dataset The MetaTaskModel is expected to get prepared MetaTask from meta\_dataset. Then it will create modified task with Qlib format which can be executed by Qlib trainer. Returns: A list of modified task definitions. Return type: List\[dict\] ### Meta Guide Model[](https://qlib.readthedocs.io/en/latest/component/meta.html#meta-guide-model "Permalink to this heading") This type of meta-model participates in the training process of the base forecasting model. The meta-model may guide the base forecasting models during their training to improve their performances. _class_ qlib.model.meta.model.MetaGuideModel[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.model.MetaGuideModel "Permalink to this definition") This type of meta-model aims to guide the training process of the base model. The meta-model interacts with the base forecasting models during their training process. _abstract_ fit(_\*args_, _\*\*kwargs_)[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.model.MetaGuideModel.fit "Permalink to this definition") The training process of the meta-model. _abstract_ inference(_\*args_, _\*\*kwargs_)[](https://qlib.readthedocs.io/en/latest/component/meta.html#qlib.model.meta.model.MetaGuideModel.inference "Permalink to this definition") The inference process of the meta-model. Returns: Some information to guide the model learning Return type: object Example[](https://qlib.readthedocs.io/en/latest/component/meta.html#example "Permalink to this heading") ---------------------------------------------------------------------------------------------------------- `Qlib` provides an implementation of `Meta Model` module, `DDG-DA`, which adapts to the market dynamics. `DDG-DA` includes four steps: 1. Calculate meta-information and encapsulate it into `Meta Task` instances. All the meta-tasks form a `Meta Dataset` instance. 2. Train `DDG-DA` based on the training data of the meta-dataset. 3. Do the inference of the `DDG-DA` to get guide information. 4. Apply guide information to the forecasting models to improve their performances. The [above example](https://github.com/microsoft/qlib/tree/main/examples/benchmarks_dynamic/DDG-DA) can be found in `examples/benchmarks_dynamic/DDG-DA/workflow.py`. --- # Online & Offline mode — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * `Online` & `Offline` mode * [View page source](https://qlib.readthedocs.io/en/latest/_sources/advanced/server.rst.txt) * * * `Online` & `Offline` mode[](https://qlib.readthedocs.io/en/latest/advanced/server.html#online-offline-mode "Permalink to this heading") ========================================================================================================================================= Introduction[](https://qlib.readthedocs.io/en/latest/advanced/server.html#introduction "Permalink to this heading") --------------------------------------------------------------------------------------------------------------------- `Qlib` supports `Online` mode and `Offline` mode. Only the `Offline` mode is introduced in this document. The `Online` mode is designed to solve the following problems: * Manage the data in a centralized way. Users don’t have to manage data of different versions. * Reduce the amount of cache to be generated. * Make the data can be accessed in a remote way. Qlib-Server[](https://qlib.readthedocs.io/en/latest/advanced/server.html#qlib-server "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------- `Qlib-Server` is the assorted server system for `Qlib`, which utilizes `Qlib` for basic calculations and provides extensive server system and cache mechanism. With QLibServer, the data provided for `Qlib` can be managed in a centralized manner. With `Qlib-Server`, users can use `Qlib` in `Online` mode. Reference[](https://qlib.readthedocs.io/en/latest/advanced/server.html#reference "Permalink to this heading") --------------------------------------------------------------------------------------------------------------- If users are interested in `Qlib-Server` and `Online` mode, please refer to [Qlib-Server Project](https://github.com/microsoft/qlib-server) and [Qlib-Server Document](https://qlib-server.readthedocs.io/en/latest/) . --- # Analysis: Evaluation & Results Analysis — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Analysis: Evaluation & Results Analysis * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/report.rst.txt) * * * Analysis: Evaluation & Results Analysis[](https://qlib.readthedocs.io/en/latest/component/report.html#analysis-evaluation-results-analysis "Permalink to this heading") ========================================================================================================================================================================= Introduction[](https://qlib.readthedocs.io/en/latest/component/report.html#introduction "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------- `Analysis` is designed to show the graphical reports of `Intraday Trading` , which helps users to evaluate and analyse investment portfolios visually. The following are some graphics to view: * analysis\_position * report\_graph * score\_ic\_graph * cumulative\_return\_graph * risk\_analysis\_graph * rank\_label\_graph * analysis\_model * model\_performance\_graph All of the accumulated profit metrics(e.g. return, max drawdown) in Qlib are calculated by summation. This avoids the metrics or the plots being skewed exponentially over time. Graphical Reports[](https://qlib.readthedocs.io/en/latest/component/report.html#graphical-reports "Permalink to this heading") -------------------------------------------------------------------------------------------------------------------------------- Users can run the following code to get all supported reports. \>> import qlib.contrib.report as qcr \>> print(qcr.GRAPH\_NAME\_LIST) \['analysis\_position.report\_graph', 'analysis\_position.score\_ic\_graph', 'analysis\_position.cumulative\_return\_graph', 'analysis\_position.risk\_analysis\_graph', 'analysis\_position.rank\_label\_graph', 'analysis\_model.model\_performance\_graph'\] Note For more details, please refer to the function document: similar to `help(qcr.analysis_position.report_graph)` Usage & Example[](https://qlib.readthedocs.io/en/latest/component/report.html#usage-example "Permalink to this heading") -------------------------------------------------------------------------------------------------------------------------- ### Usage of analysis\_position.report[](https://qlib.readthedocs.io/en/latest/component/report.html#usage-of-analysis-position-report "Permalink to this heading") #### API[](https://qlib.readthedocs.io/en/latest/component/report.html#api "Permalink to this heading") #### Graphical Result[](https://qlib.readthedocs.io/en/latest/component/report.html#graphical-result "Permalink to this heading") Note * Axis X: Trading day * Axis Y: * cum bench Cumulative returns series of benchmark * cum return wo cost Cumulative returns series of portfolio without cost * cum return w cost Cumulative returns series of portfolio with cost * return wo mdd Maximum drawdown series of cumulative return without cost * return w cost mdd: Maximum drawdown series of cumulative return with cost * cum ex return wo cost The CAR (cumulative abnormal return) series of the portfolio compared to the benchmark without cost. * cum ex return w cost The CAR (cumulative abnormal return) series of the portfolio compared to the benchmark with cost. * turnover Turnover rate series * cum ex return wo cost mdd Drawdown series of CAR (cumulative abnormal return) without cost * cum ex return w cost mdd Drawdown series of CAR (cumulative abnormal return) with cost * The shaded part above: Maximum drawdown corresponding to cum return wo cost * The shaded part below: Maximum drawdown corresponding to cum ex return wo cost ![../_images/report.png](https://qlib.readthedocs.io/en/latest/_images/report.png) ### Usage of analysis\_position.score\_ic[](https://qlib.readthedocs.io/en/latest/component/report.html#usage-of-analysis-position-score-ic "Permalink to this heading") #### API[](https://qlib.readthedocs.io/en/latest/component/report.html#id1 "Permalink to this heading") #### Graphical Result[](https://qlib.readthedocs.io/en/latest/component/report.html#id2 "Permalink to this heading") Note * Axis X: Trading day * Axis Y: * ic The Pearson correlation coefficient series between label and prediction score. In the above example, the label is formulated as Ref($close, -2)/Ref($close, -1)-1. Please refer to [Data Feature](https://qlib.readthedocs.io/en/latest/component/data.html#feature) for more details. * rank\_ic The Spearman’s rank correlation coefficient series between label and prediction score. ![../_images/score_ic.png](https://qlib.readthedocs.io/en/latest/_images/score_ic.png) ### Usage of analysis\_position.risk\_analysis[](https://qlib.readthedocs.io/en/latest/component/report.html#usage-of-analysis-position-risk-analysis "Permalink to this heading") #### API[](https://qlib.readthedocs.io/en/latest/component/report.html#id3 "Permalink to this heading") #### Graphical Result[](https://qlib.readthedocs.io/en/latest/component/report.html#id4 "Permalink to this heading") Note * general graphics * std * excess\_return\_without\_cost The Standard Deviation of CAR (cumulative abnormal return) without cost. * excess\_return\_with\_cost The Standard Deviation of CAR (cumulative abnormal return) with cost. * annualized\_return * excess\_return\_without\_cost The Annualized Rate of CAR (cumulative abnormal return) without cost. * excess\_return\_with\_cost The Annualized Rate of CAR (cumulative abnormal return) with cost. * information\_ratio * excess\_return\_without\_cost The Information Ratio without cost. * excess\_return\_with\_cost The Information Ratio with cost. To know more about Information Ratio, please refer to [Information Ratio – IR](https://www.investopedia.com/terms/i/informationratio.asp) . * max\_drawdown * excess\_return\_without\_cost The Maximum Drawdown of CAR (cumulative abnormal return) without cost. * excess\_return\_with\_cost The Maximum Drawdown of CAR (cumulative abnormal return) with cost. ![../_images/risk_analysis_bar.png](https://qlib.readthedocs.io/en/latest/_images/risk_analysis_bar.png) Note * annualized\_return/max\_drawdown/information\_ratio/std graphics * Axis X: Trading days grouped by month * Axis Y: * annualized\_return graphics * excess\_return\_without\_cost\_annualized\_return The Annualized Rate series of monthly CAR (cumulative abnormal return) without cost. * excess\_return\_with\_cost\_annualized\_return The Annualized Rate series of monthly CAR (cumulative abnormal return) with cost. * max\_drawdown graphics * excess\_return\_without\_cost\_max\_drawdown The Maximum Drawdown series of monthly CAR (cumulative abnormal return) without cost. * excess\_return\_with\_cost\_max\_drawdown The Maximum Drawdown series of monthly CAR (cumulative abnormal return) with cost. * information\_ratio graphics * excess\_return\_without\_cost\_information\_ratio The Information Ratio series of monthly CAR (cumulative abnormal return) without cost. * excess\_return\_with\_cost\_information\_ratio The Information Ratio series of monthly CAR (cumulative abnormal return) with cost. * std graphics * excess\_return\_without\_cost\_max\_drawdown The Standard Deviation series of monthly CAR (cumulative abnormal return) without cost. * excess\_return\_with\_cost\_max\_drawdown The Standard Deviation series of monthly CAR (cumulative abnormal return) with cost. ![../_images/risk_analysis_annualized_return.png](https://qlib.readthedocs.io/en/latest/_images/risk_analysis_annualized_return.png) ![../_images/risk_analysis_max_drawdown.png](https://qlib.readthedocs.io/en/latest/_images/risk_analysis_max_drawdown.png) ![../_images/risk_analysis_information_ratio.png](https://qlib.readthedocs.io/en/latest/_images/risk_analysis_information_ratio.png) ![../_images/risk_analysis_std.png](https://qlib.readthedocs.io/en/latest/_images/risk_analysis_std.png) ### Usage of analysis\_model.analysis\_model\_performance[](https://qlib.readthedocs.io/en/latest/component/report.html#usage-of-analysis-model-analysis-model-performance "Permalink to this heading") #### API[](https://qlib.readthedocs.io/en/latest/component/report.html#id5 "Permalink to this heading") #### Graphical Results[](https://qlib.readthedocs.io/en/latest/component/report.html#graphical-results "Permalink to this heading") Note * cumulative return graphics * Group1: The Cumulative Return series of stocks group with (ranking ratio of label <= 20%) * Group2: The Cumulative Return series of stocks group with (20% < ranking ratio of label <= 40%) * Group3: The Cumulative Return series of stocks group with (40% < ranking ratio of label <= 60%) * Group4: The Cumulative Return series of stocks group with (60% < ranking ratio of label <= 80%) * Group5: The Cumulative Return series of stocks group with (80% < ranking ratio of label) * long-short: The Difference series between Cumulative Return of Group1 and of Group5 * long-average The Difference series between Cumulative Return of Group1 and average Cumulative Return for all stocks. The ranking ratio can be formulated as follows. \\\[ranking\\ ratio = \\frac{Ascending\\ Ranking\\ of\\ label}{Number\\ of\\ Stocks\\ in\\ the\\ Portfolio}\\\] ![../_images/analysis_model_cumulative_return.png](https://qlib.readthedocs.io/en/latest/_images/analysis_model_cumulative_return.png) Note * long-short/long-average The distribution of long-short/long-average returns on each trading day ![../_images/analysis_model_long_short.png](https://qlib.readthedocs.io/en/latest/_images/analysis_model_long_short.png) Note * Information Coefficient * The Pearson correlation coefficient series between labels and prediction scores of stocks in portfolio. * The graphics reports can be used to evaluate the prediction scores. ![../_images/analysis_model_IC.png](https://qlib.readthedocs.io/en/latest/_images/analysis_model_IC.png) Note * Monthly IC Monthly average of the Information Coefficient ![../_images/analysis_model_monthly_IC.png](https://qlib.readthedocs.io/en/latest/_images/analysis_model_monthly_IC.png) Note * IC The distribution of the Information Coefficient on each trading day. * IC Normal Dist. Q-Q The Quantile-Quantile Plot is used for the normal distribution of Information Coefficient on each trading day. ![../_images/analysis_model_NDQ.png](https://qlib.readthedocs.io/en/latest/_images/analysis_model_NDQ.png) Note * Auto Correlation * The Pearson correlation coefficient series between the latest prediction scores and the prediction scores lag days ago of stocks in portfolio on each trading day. * The graphics reports can be used to estimate the turnover rate. ![../_images/analysis_model_auto_correlation.png](https://qlib.readthedocs.io/en/latest/_images/analysis_model_auto_correlation.png) --- # Code Standard — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Code Standard * [View page source](https://qlib.readthedocs.io/en/latest/_sources/developer/code_standard_and_dev_guide.rst.txt) * * * Code Standard[](https://qlib.readthedocs.io/en/latest/developer/code_standard_and_dev_guide.html#code-standard "Permalink to this heading") ============================================================================================================================================= Docstring[](https://qlib.readthedocs.io/en/latest/developer/code_standard_and_dev_guide.html#docstring "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------------------- Please use the [Numpydoc Style](https://stackoverflow.com/a/24385103) . Continuous Integration[](https://qlib.readthedocs.io/en/latest/developer/code_standard_and_dev_guide.html#continuous-integration "Permalink to this heading") --------------------------------------------------------------------------------------------------------------------------------------------------------------- Continuous Integration (CI) tools help you stick to the quality standards by running tests every time you push a new commit and reporting the results to a pull request. When you submit a PR request, you can check whether your code passes the CI tests in the “check” section at the bottom of the web page. 1. Qlib will check the code format with black. The PR will raise error if your code does not align to the standard of Qlib(e.g. a common error is the mixed use of space and tab). You can fix the bug by inputting the following code in the command line. pip install black python \-m black . \-l 120 2. Qlib will check your code style pylint. The checking command is implemented in \[github action workflow\]([https://github.com/microsoft/qlib/blob/0e8b94a552f1c457cfa6cd2c1bb3b87ebb3fb279/.github/workflows/test.yml#L66](https://github.com/microsoft/qlib/blob/0e8b94a552f1c457cfa6cd2c1bb3b87ebb3fb279/.github/workflows/test.yml#L66) ). Sometime pylint’s restrictions are not that reasonable. You can ignore specific errors like this return \-ICLoss()(pred, target, index) \# pylint: disable=E1130 3. Qlib will check your code style flake8. The checking command is implemented in \[github action workflow\]([https://github.com/microsoft/qlib/blob/0e8b94a552f1c457cfa6cd2c1bb3b87ebb3fb279/.github/workflows/test.yml#L73](https://github.com/microsoft/qlib/blob/0e8b94a552f1c457cfa6cd2c1bb3b87ebb3fb279/.github/workflows/test.yml#L73) ). You can fix the bug by inputing the following code in the command line. flake8 \--ignore E501,F541,E402,F401,W503,E741,E266,E203,E302,E731,E262,F523,F821,F811,F841,E713,E265,W291,E712,E722,W293 qlib 4. Qlib has integrated pre-commit, which will make it easier for developers to format their code. Just run the following two commands, and the code will be automatically formatted using black and flake8 when the git commit command is executed. pip install \-e .\[dev\] pre-commit install Development Guidance[](https://qlib.readthedocs.io/en/latest/developer/code_standard_and_dev_guide.html#development-guidance "Permalink to this heading") =========================================================================================================================================================== As a developer, you often want make changes to Qlib and hope it would reflect directly in your environment without reinstalling it. You can install Qlib in editable mode with following command. The \[dev\] option will help you to install some related packages when developing Qlib (e.g. pytest, sphinx) pip install \-e ".\[dev\]" --- # Build Docker Image — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Build Docker Image * [View page source](https://qlib.readthedocs.io/en/latest/_sources/developer/how_to_build_image.rst.txt) * * * Build Docker Image[](https://qlib.readthedocs.io/en/latest/developer/how_to_build_image.html#build-docker-image "Permalink to this heading") ============================================================================================================================================== Dockerfile[](https://qlib.readthedocs.io/en/latest/developer/how_to_build_image.html#dockerfile "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------------ There is a **Dockerfile** file in the root directory of the project from which you can build the docker image. There are two build methods in Dockerfile to choose from. When executing the build command, use the `--build-arg` parameter to control the image version. The `--build-arg` parameter defaults to `yes`, which builds the `stable` version of the qlib image. 1.For the `stable` version, use `pip install pyqlib` to build the qlib image. docker build \--build-arg IS\_STABLE\=yes \-t \-f ./Dockerfile . docker build \-t \-f ./Dockerfile . 2. For the `nightly` version, use current source code to build the qlib image. docker build \--build-arg IS\_STABLE\=no \-t \-f ./Dockerfile . Auto build of qlib images[](https://qlib.readthedocs.io/en/latest/developer/how_to_build_image.html#auto-build-of-qlib-images "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------------------ 1. There is a **build\_docker\_image.sh** file in the root directory of your project, which can be used to automatically build docker images and upload them to your docker hub repository(Optional, configuration required). sh build\_docker\_image.sh >>> Do you want to build the nightly version of the qlib image? (default is stable) (yes/no): >>> Is it uploaded to docker hub? (default is no) (yes/no): 2. If you want to upload the built image to your docker hub repository, you need to edit your **build\_docker\_image.sh** file first, fill in `docker_user` in the file, and then execute this file. How to use qlib images[](https://qlib.readthedocs.io/en/latest/developer/how_to_build_image.html#how-to-use-qlib-images "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------------ 1. Start a new Docker container docker run \-it \--name \-v :/app 2. At this point you are in the docker environment and can run the qlib scripts. An example: \>>> python scripts/get\_data.py qlib\_data \--name qlib\_data\_simple \--target\_dir ~/.qlib/qlib\_data/cn\_data \--interval 1d \--region cn >>> python qlib/cli/run.py examples/benchmarks/LightGBM/workflow\_config\_lightgbm\_Alpha158.yaml 3. Exit the container \>>> exit 4. Restart the container docker start \-i \-a 5. Stop the container docker stop \-i \-a 6. Delete the container docker rm 7. For more information on using docker see the [docker documentation](https://docs.docker.com/reference/cli/docker/) . --- # Reinforcement Learning in Quantitative Trading — QLib 0.9.7 documentation * [](https://qlib.readthedocs.io/en/v0.9.7/index.html) * [Reinforcement Learning in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.7/component/rl/toctree.html) * Reinforcement Learning in Quantitative Trading * [View page source](https://qlib.readthedocs.io/en/v0.9.7/_sources/component/rl/overall.rst.txt) * * * Reinforcement Learning in Quantitative Trading[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#reinforcement-learning-in-quantitative-trading "Permalink to this heading") ============================================================================================================================================================================================== Reinforcement Learning[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#reinforcement-learning "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------- Different from supervised learning tasks such as classification tasks and regression tasks. Another important paradigm in machine learning is Reinforcement Learning(RL), which attempts to optimize an accumulative numerical reward signal by directly interacting with the environment under a few assumptions such as Markov Decision Process(MDP). As demonstrated in the following figure, an RL system consists of four elements, 1)the agent 2) the environment the agent interacts with 3) the policy that the agent follows to take actions on the environment and 4)the reward signal from the environment to the agent. In general, the agent can perceive and interpret its environment, take actions and learn through reward, to seek long-term and maximum overall reward to achieve an optimal solution. [![../../_images/RL_framework.png](https://qlib.readthedocs.io/en/v0.9.7/_images/RL_framework.png)](https://qlib.readthedocs.io/en/v0.9.7/_images/RL_framework.png) RL attempts to learn to produce actions by trial and error. By sampling actions and then observing which one leads to our desired outcome, a policy is obtained to generate optimal actions. In contrast to supervised learning, RL learns this not from a label but from a time-delayed label called a reward. This scalar value lets us know whether the current outcome is good or bad. In a word, the target of RL is to take actions to maximize reward. The Qlib Reinforcement Learning toolkit (QlibRL) is an RL platform for quantitative investment, which provides support to implement the RL algorithms in Qlib. Potential Application Scenarios in Quantitative Trading[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- RL methods have demonstrated remarkable achievements in various applications, including game playing, resource allocation, recommendation systems, marketing, and advertising. In the context of investment, which involves continuous decision-making, let’s consider the example of the stock market. Investors strive to optimize their investment returns by effectively managing their positions and stock holdings through various buying and selling behaviors. Furthermore, investors carefully evaluate market conditions and stock-specific information before making each buying or selling decision. From an investor’s perspective, this process can be viewed as a continuous decision-making process driven by interactions with the market. RL algorithms offer a promising approach to tackle such challenges. Here are several scenarios where RL holds potential for application in quantitative investment. ### Order Execution[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#order-execution "Permalink to this heading") The order execution task is to execute orders efficiently while considering multiple factors, including optimal prices, minimizing trading costs, reducing market impact, maximizing order fullfill rates, and achieving execution within a specified time frame. RL can be applied to such tasks by incorporating these objectives into the reward function and action selection process. Specifically, the RL agent interacts with the market environment, observes the state from market information, and makes decisions on next step execution. The RL algorithm learns an optimal execution strategy through trial and error, aiming to maximize the expected cumulative reward, which incorporates the desired objectives. > * General Setting > > * Environment: The environment represents the financial market where order execution takes place. It encompasses variables such as the order book dynamics, liquidity, price movements, and market conditions. > > * State: The state refers to the information available to the RL agent at a given time step. It typically includes features such as the current order book state (bid-ask spread, order depth), historical price data, historical trading volume, market volatility, and any other relevant information that can aid in decision-making. > > * Action: The action is the decision made by the RL agent based on the observed state. In order execution, actions can include selecting the order size, price, and timing of execution. > > * Reward: The reward is a scalar signal that indicates the performance of the RL agent’s action in the environment. The reward function is designed to encourage actions that lead to efficient and cost-effective order execution. It typically considers multiple objectives, such as maximizing price advantages, minimizing trading costs (including transaction fees and slippage), reducing market impact (the effect of the order on the market price) and maximizing order fullfill rates. > > > * Scenarios > > * Single-asset order execution: Single-asset order execution focuses on the task of executing a single order for a specific asset, such as a stock or a cryptocurrency. The primary objective is to execute the order efficiently while considering factors such as maximizing price advantages, minimizing trading costs, reducing market impact, and achieving a high fullfill rate. The RL agent interacts with the market environment and makes decisions on order size, price, and timing of execution for that particular asset. The goal is to learn an optimal execution strategy for the single asset, maximizing the expected cumulative reward while considering the specific dynamics and characteristics of that asset. > > * Multi-asset order execution: Multi-asset order execution expands the order execution task to involve multiple assets or securities. It typically involves executing a portfolio of orders across different assets simultaneously or sequentially. Unlike single-asset order execution, the focus is not only on the execution of individual orders but also on managing the interactions and dependencies between different assets within the portfolio. The RL agent needs to make decisions on the order sizes, prices, and timings for each asset in the portfolio, considering their interdependencies, cash constraints, market conditions, and transaction costs. The goal is to learn an optimal execution strategy that balances the execution efficiency for each asset while considering the overall performance and objectives of the portfolio as a whole. > > The choice of settings and RL algorithm depends on the specific requirements of the task, available data, and desired performance objectives. ### Portfolio Construction[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/overall.html#portfolio-construction "Permalink to this heading") Portfolio construction is a process of selecting and allocating assets in an investment portfolio. RL provides a framework to optimize portfolio management decisions by learning from interactions with the market environment and maximizing long-term returns while considering risk management. * General Setting * State: The state represents the current information about the market and the portfolio. It typically includes historical prices and volumes, technical indicators, and other relevant data. * Action: The action corresponds to the decision of allocating capital to different assets in the portfolio. It determines the weights or proportions of investments in each asset. * Reward: The reward is a metric that evaluates the performance of the portfolio. It can be defined in various ways, such as total return, risk-adjusted return, or other objectives like maximizing Sharpe ratio or minimizing drawdown. * Scenarios * Stock market: RL can be used to construct portfolios of stocks, where the agent learns to allocate capital among different stocks. * Cryptocurrency market: RL can be applied to construct portfolios of cryptocurrencies, where the agent learns to make allocation decisions. * Foreign exchange (Forex) market: RL can be used to construct portfolios of currency pairs, where the agent learns to allocate capital across different currencies based on exchange rate data, economic indicators, and other factors. Similarly, the choice of basic setting and algorithm depends on the specific requirements of the problem and the characteristics of the market. --- # The Framework of QlibRL — QLib 0.9.7 documentation * [](https://qlib.readthedocs.io/en/v0.9.7/index.html) * [Reinforcement Learning in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.7/component/rl/toctree.html) * The Framework of QlibRL * [View page source](https://qlib.readthedocs.io/en/v0.9.7/_sources/component/rl/framework.rst.txt) * * * The Framework of QlibRL[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html#the-framework-of-qlibrl "Permalink to this heading") ================================================================================================================================================== QlibRL contains a full set of components that cover the entire lifecycle of an RL pipeline, including building the simulator of the market, shaping states & actions, training policies (strategies), and backtesting strategies in the simulated environment. QlibRL is basically implemented with the support of Tianshou and Gym frameworks. The high-level structure of QlibRL is demonstrated below: [![../../_images/QlibRL_framework.png](https://qlib.readthedocs.io/en/v0.9.7/_images/QlibRL_framework.png)](https://qlib.readthedocs.io/en/v0.9.7/_images/QlibRL_framework.png) Here, we briefly introduce each component in the figure. EnvWrapper[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html#envwrapper "Permalink to this heading") ------------------------------------------------------------------------------------------------------------------------ EnvWrapper is the complete capsulation of the simulated environment. It receives actions from outside (policy/strategy/agent), simulates the changes in the market, and then replies rewards and updated states, thus forming an interaction loop. In QlibRL, EnvWrapper is a subclass of gym.Env, so it implements all necessary interfaces of gym.Env. Any classes or pipelines that accept gym.Env should also accept EnvWrapper. Developers do not need to implement their own EnvWrapper to build their own environment. Instead, they only need to implement 4 components of the EnvWrapper: * Simulator The simulator is the core component responsible for the environment simulation. Developers could implement all the logic that is directly related to the environment simulation in the Simulator in any way they like. In QlibRL, there are already two implementations of Simulator for single asset trading: 1) `SingleAssetOrderExecution`, which is built based on Qlib’s backtest toolkits and hence considers a lot of practical trading details but is slow. 2) `SimpleSingleAssetOrderExecution`, which is built based on a simplified trading simulator, which ignores a lot of details (e.g. trading limitations, rounding) but is quite fast. * State interpreter The state interpreter is responsible for “interpret” states in the original format (format provided by the simulator) into states in a format that the policy could understand. For example, transform unstructured raw features into numerical tensors. * Action interpreter The action interpreter is similar to the state interpreter. But instead of states, it interprets actions generated by the policy, from the format provided by the policy to the format that is acceptable to the simulator. * Reward function The reward function returns a numerical reward to the policy after each time the policy takes an action. EnvWrapper will organically organize these components. Such decomposition allows for better flexibility in development. For example, if the developers want to train multiple types of policies in the same environment, they only need to design one simulator and design different state interpreters/action interpreters/reward functions for different types of policies. QlibRL has well-defined base classes for all these 4 components. All the developers need to do is define their own components by inheriting the base classes and then implementing all interfaces required by the base classes. The API for the above base components can be found [here](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.rl) . Policy[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html#policy "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------- QlibRL directly uses Tianshou’s policy. Developers could use policies provided by Tianshou off the shelf, or implement their own policies by inheriting Tianshou’s policies. Training Vessel & Trainer[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/framework.html#training-vessel-trainer "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------- As stated by their names, training vessels and trainers are helper classes used in training. A training vessel is a ship that contains a simulator/interpreters/reward function/policy, and it controls algorithm-related parts of training. Correspondingly, the trainer is responsible for controlling the runtime parts of training. As you may have noticed, a training vessel itself holds all the required components to build an EnvWrapper rather than holding an instance of EnvWrapper directly. This allows the training vessel to create duplicates of EnvWrapper dynamically when necessary (for example, under parallel training). With a training vessel, the trainer could finally launch the training pipeline by simple, Scikit-learn-like interfaces (i.e., `trainer.fit()`). The API for Trainer and TrainingVessel and can be found [here](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#module-qlib.rl.trainer) . The RL module is designed in a loosely-coupled way. Currently, RL examples are integrated with concrete business logic. But the core part of RL is much simpler than what you see. To demonstrate the simple core of RL, [a dedicated notebook](https://github.com/microsoft/qlib/tree/main/examples/rl/simple_example.ipynb) for RL without business loss is created. --- # Qlib: Quantitative Platform — QLib 0.9.2 documentation * [Docs](https://qlib.readthedocs.io/en/v0.9.2/index.html) » * `Qlib`: Quantitative Platform * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.9.2/docs/introduction/introduction.rst) * * * `Qlib`: Quantitative Platform[¶](https://qlib.readthedocs.io/en/v0.9.2/introduction/introduction.html#qlib-quantitative-platform "Permalink to this headline") =============================================================================================================================================================== Introduction[¶](https://qlib.readthedocs.io/en/v0.9.2/introduction/introduction.html#introduction "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------- ![../_images/white_bg_rec+word.png](https://qlib.readthedocs.io/en/v0.9.2/_images/white_bg_rec+word.png) `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`, users can easily try their ideas to create better Quant investment strategies. Framework[¶](https://qlib.readthedocs.io/en/v0.9.2/introduction/introduction.html#framework "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------- ![../_images/framework1.svg](https://qlib.readthedocs.io/en/v0.9.2/_images/framework1.svg) At the module level, Qlib is a platform that consists of above components. The components are designed as loose-coupled modules and each component could be used stand-alone. This framework may be intimidating for new users to Qlib. It tries to accurately include a lot of details of Qlib’s design. For users new to Qlib, you can skip it first and read it later. | Name | Description | | --- | --- | | Infrastructure layer | Infrastructure layer provides underlying support for Quant research. DataServer provides high-performance infrastructure for users to manage and retrieve raw data. Trainer provides flexible interface to control the training process of models which enable algorithms controlling the training process. | | Learning Framework layer | The Forecast Model and Trading Agent are learnable. They are learned based on the Learning Framework layer and then applied to multiple scenarios in Workflow layer. The supported learning paradigms can be categorized into reinforcement learning and supervised learning. The learning framework leverages the Workflow layer as well(e.g. sharing Information Extractor, creating environments based on Execution Env). | | Workflow layer | Workflow layer covers the whole workflow of quantitative investment. Both supervised-learning-based strategies and RL-based Strategies are supported. Information Extractor extracts data for models. Forecast Model focuses on producing all kinds of forecast signals (e.g. _alpha_, risk) for other modules. With these signals Decision Generator will generate the target trading decisions(i.e. portfolio, orders) If RL-based Strategies are adopted, the Policy is learned in a end-to-end way, the trading deicsions are generated directly. Decisions will be executed by Execution Env (i.e. the trading market). There may be multiple levels of Strategy and Executor (e.g. an _order executor trading strategy and intraday order executor_ could behave like an interday trading loop and be nested in _daily portfolio management trading strategy and interday trading executor_ trading loop) | | Interface layer | Interface layer tries to present a user-friendly interface for the underlying system. Analyser module will provide users detailed analysis reports of forecasting signals, portfolios and execution results | * The modules with hand-drawn style are under development and will be released in the future. * The modules with dashed borders are highly user-customizable and extendible. (p.s. framework image is created with [https://draw.io/](https://draw.io/) ) --- # Quick Start — QLib 0.9.7 documentation * [](https://qlib.readthedocs.io/en/v0.9.7/index.html) * [Reinforcement Learning in Quantitative Trading](https://qlib.readthedocs.io/en/v0.9.7/component/rl/toctree.html) * Quick Start * [View page source](https://qlib.readthedocs.io/en/v0.9.7/_sources/component/rl/quickstart.rst.txt) * * * Quick Start[](https://qlib.readthedocs.io/en/v0.9.7/component/rl/quickstart.html#quick-start "Permalink to this heading") =========================================================================================================================== QlibRL provides an example of an implementation of a single asset order execution task and the following is an example of the config file to train with QlibRL. simulator: \# Each step contains 30mins time\_per\_step: 30 \# Upper bound of volume, should be null or a float between 0 and 1, if it is a float, represent upper bound is calculated by the percentage of the market volume vol\_limit: null env: \# Concurrent environment workers. concurrency: 1 \# dummy or subproc or shmem. Corresponding to \`parallelism in tianshou \`\_. parallel\_mode: dummy action\_interpreter: class: CategoricalActionInterpreter kwargs: \# Candidate actions, it can be a list with length L: \[a\_1, a\_2,..., a\_L\] or an integer n, in which case the list of length n+1 is auto-generated, i.e., \[0, 1/n, 2/n,..., n/n\]. values: 14 \# Total number of steps (an upper-bound estimation) max\_step: 8 module\_path: qlib.rl.order\_execution.interpreter state\_interpreter: class: FullHistoryStateInterpreter kwargs: \# Number of dimensions in data. data\_dim: 6 \# Equal to the total number of records. For example, in SAOE per minute, data\_ticks is the length of the day in minutes. data\_ticks: 240 \# The total number of steps (an upper-bound estimation). For example, 390min / 30min-per-step = 13 steps. max\_step: 8 \# Provider of the processed data. processed\_data\_provider: class: PickleProcessedDataProvider module\_path: qlib.rl.data.pickle\_styled kwargs: data\_dir: ./data/pickle\_dataframe/feature module\_path: qlib.rl.order\_execution.interpreter reward: class: PAPenaltyReward kwargs: \# The penalty for a large volume in a short time. penalty: 100.0 module\_path: qlib.rl.order\_execution.reward data: source: order\_dir: ./data/training\_order\_split data\_dir: ./data/pickle\_dataframe/backtest \# number of time indexes total\_time: 240 \# start time index default\_start\_time: 0 \# end time index default\_end\_time: 240 proc\_data\_dim: 6 num\_workers: 0 queue\_size: 20 network: class: Recurrent module\_path: qlib.rl.order\_execution.network policy: class: PPO kwargs: lr: 0.0001 module\_path: qlib.rl.order\_execution.policy runtime: seed: 42 use\_cuda: false trainer: max\_epoch: 2 \# Number of episodes collected in each training iteration repeat\_per\_collect: 5 earlystop\_patience: 2 \# Episodes per collect at training. episode\_per\_collect: 20 batch\_size: 16 \# Perform validation every n iterations val\_every\_n\_epoch: 1 checkpoint\_path: ./checkpoints checkpoint\_every\_n\_iters: 1 And the config file for backtesting: order\_file: ./data/backtest\_orders.csv start\_time: "9:45" end\_time: "14:44" qlib: provider\_uri\_1min: ./data/bin feature\_root\_dir: ./data/pickle \# feature generated by today's information feature\_columns\_today: \[\ "$open", "$high", "$low", "$close", "$vwap", "$volume",\ \] \# feature generated by yesterday's information feature\_columns\_yesterday: \[\ "$open\_v1", "$high\_v1", "$low\_v1", "$close\_v1", "$vwap\_v1", "$volume\_v1",\ \] exchange: \# the expression for buying and selling stock limitation limit\_threshold: \['$close \== 0', '$close \== 0'\] \# deal price for buying and selling deal\_price: \["If($close \== 0, $vwap, $close)", "If($close \== 0, $vwap, $close)"\] volume\_threshold: \# volume limits are both buying and selling, "cum" means that this is a cumulative value over time all: \["cum", "0.2 \* DayCumsum($volume, '9:45', '14:44')"\] \# the volume limits of buying buy: \["current", "$close"\] \# the volume limits of selling, "current" means that this is a real-time value and will not accumulate over time sell: \["current", "$close"\] strategies: 30min: class: TWAPStrategy module\_path: qlib.contrib.strategy.rule\_strategy kwargs: {} 1day: class: SAOEIntStrategy module\_path: qlib.rl.order\_execution.strategy kwargs: state\_interpreter: class: FullHistoryStateInterpreter module\_path: qlib.rl.order\_execution.interpreter kwargs: max\_step: 8 data\_ticks: 240 data\_dim: 6 processed\_data\_provider: class: PickleProcessedDataProvider module\_path: qlib.rl.data.pickle\_styled kwargs: data\_dir: ./data/pickle\_dataframe/feature action\_interpreter: class: CategoricalActionInterpreter module\_path: qlib.rl.order\_execution.interpreter kwargs: values: 14 max\_step: 8 network: class: Recurrent module\_path: qlib.rl.order\_execution.network kwargs: {} policy: class: PPO module\_path: qlib.rl.order\_execution.policy kwargs: lr: 1.0e-4 \# Local path to the latest model. The model is generated during training, so please run training first if you want to run backtest with a trained policy. You could also remove this parameter file to run backtest with a randomly initialized policy. weight\_file: ./checkpoints/latest.pth \# Concurrent environment workers. concurrency: 5 With the above config files, you can start training the agent by the following command: $ python \-m qlib.rl.contrib.train\_onpolicy.py \--config\_path train\_config.yml After the training, you can backtest with the following command: $ python \-m qlib.rl.contrib.backtest.py \--config\_path backtest\_config.yml In that case, `SingleAssetOrderExecution` and [`SingleAssetOrderExecutionSimple`](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#qlib.rl.order_execution.SingleAssetOrderExecutionSimple "qlib.rl.order_execution.simulator_simple.SingleAssetOrderExecutionSimple") as examples for simulator, [`qlib.rl.order_execution.interpreter.FullHistoryStateInterpreter`](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#qlib.rl.order_execution.FullHistoryStateInterpreter "qlib.rl.order_execution.interpreter.FullHistoryStateInterpreter") and [`qlib.rl.order_execution.interpreter.CategoricalActionInterpreter`](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#qlib.rl.order_execution.CategoricalActionInterpreter "qlib.rl.order_execution.interpreter.CategoricalActionInterpreter") as examples for interpreter, [`qlib.rl.order_execution.policy.PPO`](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#qlib.rl.order_execution.PPO "qlib.rl.order_execution.policy.PPO") as an example for policy, and [`qlib.rl.order_execution.reward.PAPenaltyReward`](https://qlib.readthedocs.io/en/v0.9.7/reference/api.html#qlib.rl.order_execution.PAPenaltyReward "qlib.rl.order_execution.reward.PAPenaltyReward") as an example for reward. For the single asset order execution task, if developers have already defined their simulator/interpreters/reward function/policy, they could launch the training and backtest pipeline by simply modifying the corresponding settings in the config files. The details about the example can be found [here](https://github.com/microsoft/qlib/blob/main/examples/rl/README.md) . In the future, we will provide more examples for different scenarios such as RL-based portfolio construction. --- # Reinforcement Learning in Quantitative Trading — QLib 0.9.7 documentation * [](https://qlib.readthedocs.io/en/stable/index.html) * Reinforcement Learning in Quantitative Trading * [View page source](https://qlib.readthedocs.io/en/stable/_sources/component/rl/toctree.rst.txt) * * * Reinforcement Learning in Quantitative Trading[](https://qlib.readthedocs.io/en/stable/component/rl/toctree.html#reinforcement-learning-in-quantitative-trading "Permalink to this heading") ============================================================================================================================================================================================== * [Guidance](https://qlib.readthedocs.io/en/stable/component/rl/guidance.html) * [Beginners to Reinforcement Learning Algorithms](https://qlib.readthedocs.io/en/stable/component/rl/guidance.html#beginners-to-reinforcement-learning-algorithms) * [Reinforcement Learning Algorithm Researcher](https://qlib.readthedocs.io/en/stable/component/rl/guidance.html#reinforcement-learning-algorithm-researcher) * [Quantitative Researcher](https://qlib.readthedocs.io/en/stable/component/rl/guidance.html#quantitative-researcher) * [Overall](https://qlib.readthedocs.io/en/stable/component/rl/overall.html) * [Reinforcement Learning](https://qlib.readthedocs.io/en/stable/component/rl/overall.html#reinforcement-learning) * [Potential Application Scenarios in Quantitative Trading](https://qlib.readthedocs.io/en/stable/component/rl/overall.html#potential-application-scenarios-in-quantitative-trading) * [Order Execution](https://qlib.readthedocs.io/en/stable/component/rl/overall.html#order-execution) * [Portfolio Construction](https://qlib.readthedocs.io/en/stable/component/rl/overall.html#portfolio-construction) * [Quick Start](https://qlib.readthedocs.io/en/stable/component/rl/quickstart.html) * [Framework](https://qlib.readthedocs.io/en/stable/component/rl/framework.html) * [EnvWrapper](https://qlib.readthedocs.io/en/stable/component/rl/framework.html#envwrapper) * [Policy](https://qlib.readthedocs.io/en/stable/component/rl/framework.html#policy) * [Training Vessel & Trainer](https://qlib.readthedocs.io/en/stable/component/rl/framework.html#training-vessel-trainer) --- # Qlib Initialization — QLib 0.9.2 documentation * [Docs](https://qlib.readthedocs.io/en/v0.9.2/index.html) » * Qlib Initialization * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.9.2/docs/start/initialization.rst) * * * Qlib Initialization[¶](https://qlib.readthedocs.io/en/v0.9.2/start/initialization.html#qlib-initialization "Permalink to this headline") ========================================================================================================================================= Initialization[¶](https://qlib.readthedocs.io/en/v0.9.2/start/initialization.html#id1 "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------- Please follow the steps below to initialize `Qlib`. Download and prepare the Data: execute the following command to download stock data. Please pay attention that the data is collected from [Yahoo Finance](https://finance.yahoo.com/lookup) and the data might not be perfect. We recommend users to prepare their own data if they have high-quality datasets. Please refer to [Data](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#converting-csv-format-into-qlib-format) for more information about customized dataset. > python scripts/get\_data.py qlib\_data \--target\_dir ~/.qlib/qlib\_data/cn\_data \--region cn Please refer to [Data Preparation](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#data-preparation) for more information about get\_data.py, Initialize Qlib before calling other APIs: run following code in python. > import qlib > \# region in \[REG\_CN, REG\_US\] > from qlib.constant import REG\_CN > provider\_uri \= "~/.qlib/qlib\_data/cn\_data" \# target\_dir > qlib.init(provider\_uri\=provider\_uri, region\=REG\_CN) Note Do not import qlib package in the repository directory of `Qlib`, otherwise, errors may occur. ### Parameters[¶](https://qlib.readthedocs.io/en/v0.9.2/start/initialization.html#parameters "Permalink to this headline") Besides provider\_uri and region, qlib.init has other parameters. The following are several important parameters of qlib.init (Qlib has a lot of config. Only part of parameters are limited here. More detailed setting can be found [here](https://github.com/microsoft/qlib/blob/main/qlib/config.py) ): * provider\_uri Type: str. The URI of the Qlib data. For example, it could be the location where the data loaded by `get_data.py` are stored. * region Type: str, optional parameter(default: qlib.constant.REG\_CN). Currently: `qlib.constant.REG_US` (‘us’) and `qlib.constant.REG_CN` (‘cn’) is supported. Different value of region will result in different stock market mode. - `qlib.constant.REG_US`: US stock market. - `qlib.constant.REG_CN`: China stock market. Different modes will result in different trading limitations and costs. The region is just [shortcuts for defining a batch of configurations](https://github.com/microsoft/qlib/blob/528f74af099bf6156e9480bcd2bb28e453231212/qlib/config.py#L249) , which include minimal trading order unit (`trade_unit`), trading limitation (`limit_threshold`) , etc. It is not a necessary part and users can set the key configurations manually if the existing region setting can’t meet their requirements. * redis\_host Type: str, optional parameter(default: “127.0.0.1”), host of redis The lock and cache mechanism relies on redis. * redis\_port Type: int, optional parameter(default: 6379), port of redis Note The value of region should be aligned with the data stored in provider\_uri. Currently, `scripts/get_data.py` only provides China stock market data. If users want to use the US stock market data, they should prepare their own US-stock data in provider\_uri and switch to US-stock mode. Note If Qlib fails to connect redis via redis\_host and redis\_port, cache mechanism will not be used! Please refer to [Cache](https://qlib.readthedocs.io/en/v0.9.2/component/data.html#cache) for details. * exp\_manager Type: dict, optional parameter, the setting of experiment manager to be used in qlib. Users can specify an experiment manager class, as well as the tracking URI for all the experiments. However, please be aware that we only support input of a dictionary in the following style for exp\_manager. For more information about exp\_manager, users can refer to [Recorder: Experiment Management](https://qlib.readthedocs.io/en/v0.9.2/component/recorder.html) . \# For example, if you want to set your tracking\_uri to a , you can initialize qlib below qlib.init(provider\_uri\=provider\_uri, region\=REG\_CN, exp\_manager\= { "class": "MLflowExpManager", "module\_path": "qlib.workflow.expm", "kwargs": { "uri": "python\_execution\_path/mlruns", "default\_exp\_name": "Experiment", } }) * mongo Type: dict, optional parameter, the setting of [MongoDB](https://www.mongodb.com/) which will be used in some features such as [Task Management](https://qlib.readthedocs.io/en/v0.9.2/advanced/task_management.html) , with high performance and clustered processing. Users need to follow the steps in [installation](https://www.mongodb.com/try/download/community) to install MongoDB firstly and then access it via a URI. Users can access mongodb with credential by setting “task\_url” to a string like “mongodb://%s:%s@%s” % (user, pwd, host + “:” + port). \# For example, you can initialize qlib below qlib.init(provider\_uri\=provider\_uri, region\=REG\_CN, mongo\={ "task\_url": "mongodb://localhost:27017/", \# your mongo url "task\_db\_name": "rolling\_db", \# the database name of Task Management }) * logging\_level The logging level for the system. * kernels The number of processes used when calculating features in Qlib’s expression engine. It is very helpful to set it to 1 when you are debuggin an expression calculating exception --- # Installation — QLib 0.9.2 documentation * [Docs](https://qlib.readthedocs.io/en/v0.9.2/index.html) » * Installation * [Edit on GitHub](https://github.com/microsoft/qlib/blob/v0.9.2/docs/start/installation.rst) * * * Installation[¶](https://qlib.readthedocs.io/en/v0.9.2/start/installation.html#installation "Permalink to this headline") ========================================================================================================================= `Qlib` Installation[¶](https://qlib.readthedocs.io/en/v0.9.2/start/installation.html#qlib-installation "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------------------------- Note Qlib supports both Windows and Linux. It’s recommended to use Qlib in Linux. `Qlib` supports Python3, which is up to Python3.8. Users can easily install `Qlib` by pip according to the following command: pip install pyqlib Also, Users can install `Qlib` by the source code according to the following steps: * Enter the root directory of `Qlib`, in which the file `setup.py` exists. * Then, please execute the following command to install the environment dependencies and install `Qlib`: > $ pip install numpy > $ pip install \--upgrade cython > $ git clone https://github.com/microsoft/qlib.git && cd qlib > $ python setup.py install Note It’s recommended to use anaconda/miniconda to setup the environment. `Qlib` needs lightgbm and pytorch packages, use pip to install them. Use the following code to make sure the installation successful: \>>> import qlib \>>> qlib.\_\_version\_\_ --- # Building Formulaic Alphas — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Building Formulaic Alphas * [View page source](https://qlib.readthedocs.io/en/latest/_sources/advanced/alpha.rst.txt) * * * Building Formulaic Alphas[](https://qlib.readthedocs.io/en/latest/advanced/alpha.html#building-formulaic-alphas "Permalink to this heading") ============================================================================================================================================== Introduction[](https://qlib.readthedocs.io/en/latest/advanced/alpha.html#introduction "Permalink to this heading") -------------------------------------------------------------------------------------------------------------------- In quantitative trading practice, designing novel factors that can explain and predict future asset returns are of vital importance to the profitability of a strategy. Such factors are usually called alpha factors, or alphas in short. A formulaic alpha, as the name suggests, is a kind of alpha that can be presented as a formula or a mathematical expression. Building Formulaic Alphas in `Qlib`[](https://qlib.readthedocs.io/en/latest/advanced/alpha.html#building-formulaic-alphas-in-qlib "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------------------- In `Qlib`, users can easily build formulaic alphas. ### Example[](https://qlib.readthedocs.io/en/latest/advanced/alpha.html#example "Permalink to this heading") MACD, short for moving average convergence/divergence, is a formulaic alpha used in technical analysis of stock prices. It is designed to reveal changes in the strength, direction, momentum, and duration of a trend in a stock’s price. MACD can be presented as the following formula: \\\[MACD = 2\\times (DIF-DEA)\\\] Note DIF means Differential value, which is 12-period EMA minus 26-period EMA. \\\[DIF = \\frac{EMA(CLOSE, 12) - EMA(CLOSE, 26)}{CLOSE}\\\] DEA means a 9-period EMA of the DIF. \\\[DEA = EMA(DIF, 9)\\\] Users can use `Data Handler` to build formulaic alphas MACD in qlib: Note Users need to initialize `Qlib` with qlib.init first. Please refer to [initialization](https://qlib.readthedocs.io/en/latest/start/initialization.html) . \>> from qlib.data.dataset.loader import QlibDataLoader \>> MACD\_EXP \= '2 \* ((EMA($close, 12) - EMA($close, 26))/$close - EMA((EMA($close, 12) - EMA($close, 26))/$close, 9))' \>> fields \= \[MACD\_EXP\] \# MACD \>> names \= \['MACD'\] \>> labels \= \['Ref($close, -2)/Ref($close, -1) - 1'\] \# label \>> label\_names \= \['LABEL'\] \>> data\_loader\_config \= { .. "feature": (fields, names), .. "label": (labels, label\_names) .. } \>> data\_loader \= QlibDataLoader(config\=data\_loader\_config) \>> df \= data\_loader.load(instruments\='csi300', start\_time\='2010-01-01', end\_time\='2017-12-31') \>> print(df) feature label MACD LABEL datetime instrument 2010\-01\-04 SH600000 0.008781 \-0.019672 SH600004 0.006699 \-0.014721 SH600006 0.005714 0.002911 SH600008 0.000798 0.009818 SH600009 0.017015 \-0.017758 ... ... ... 2017\-12\-29 SZ300124 0.015071 \-0.005074 SZ300136 \-0.015466 0.056352 SZ300144 0.013082 0.011853 SZ300251 \-0.001026 0.021739 SZ300315 \-0.007559 0.012455 Reference[](https://qlib.readthedocs.io/en/latest/advanced/alpha.html#reference "Permalink to this heading") -------------------------------------------------------------------------------------------------------------- To learn more about `Data Loader`, please refer to [Data Loader](https://qlib.readthedocs.io/en/latest/component/data.html#data-loader) To learn more about `Data API`, please refer to [Data API](https://qlib.readthedocs.io/en/latest/component/data.html) --- # Data Layer: Data Framework & Usage — QLib 0.9.8.dev11 documentation * [](https://qlib.readthedocs.io/en/latest/index.html) * Data Layer: Data Framework & Usage * [View page source](https://qlib.readthedocs.io/en/latest/_sources/component/data.rst.txt) * * * Data Layer: Data Framework & Usage[](https://qlib.readthedocs.io/en/latest/component/data.html#data-layer-data-framework-usage "Permalink to this heading") ============================================================================================================================================================= Introduction[](https://qlib.readthedocs.io/en/latest/component/data.html#introduction "Permalink to this heading") -------------------------------------------------------------------------------------------------------------------- `Data Layer` provides user-friendly APIs to manage and retrieve data. It provides high-performance data infrastructure. It is designed for quantitative investment. For example, users could build formulaic alphas with `Data Layer` easily. Please refer to [Building Formulaic Alphas](https://qlib.readthedocs.io/en/latest/advanced/alpha.html) for more details. The introduction of `Data Layer` includes the following parts. * Data Preparation * Data API * Data Loader * Data Handler * Dataset * Cache * Data and Cache File Structure Here is a typical example of Qlib data workflow * Users download data and converting data into Qlib format(with filename suffix .bin). In this step, typically only some basic data are stored on disk(such as OHLCV). * Creating some basic features based on Qlib’s expression Engine(e.g. “Ref($close, 60) / $close”, the return of last 60 trading days). Supported operators in the expression engine can be found [here](https://github.com/microsoft/qlib/blob/main/qlib/data/ops.py) . This step is typically implemented in Qlib’s [Data Loader](https://qlib.readthedocs.io/en/latest/component/data.html#data-loader) which is a component of [Data Handler](https://qlib.readthedocs.io/en/latest/component/data.html#data-handler) . * If users require more complicated data processing (e.g. data normalization), [Data Handler](https://qlib.readthedocs.io/en/latest/component/data.html#data-handler) support user-customized processors to process data(some predefined processors can be found [here](https://github.com/microsoft/qlib/blob/main/qlib/data/dataset/processor.py) ). The processors are different from operators in expression engine. It is designed for some complicated data processing methods which is hard to supported in operators in expression engine. * At last, [Dataset](https://qlib.readthedocs.io/en/latest/component/data.html#dataset) is responsible to prepare model-specific dataset from the processed data of Data Handler Data Preparation[](https://qlib.readthedocs.io/en/latest/component/data.html#data-preparation "Permalink to this heading") ---------------------------------------------------------------------------------------------------------------------------- ### Qlib Format Data[](https://qlib.readthedocs.io/en/latest/component/data.html#qlib-format-data "Permalink to this heading") We’ve specially designed a data structure to manage financial data, please refer to the [File storage design section in Qlib paper](https://arxiv.org/abs/2009.11189) for detailed information. Such data will be stored with filename suffix .bin (We’ll call them .bin file, .bin format, or qlib format). .bin file is designed for scientific computing on finance data. `Qlib` provides two different off-the-shelf datasets, which can be accessed through this [link](https://github.com/microsoft/qlib/blob/main/qlib/contrib/data/handler.py) : | Dataset | US Market | China Market | | --- | --- | --- | | Alpha360 | √ | √ | | Alpha158 | √ | √ | Also, `Qlib` provides a high-frequency dataset. Users can run a high-frequency dataset example through this [link](https://github.com/microsoft/qlib/tree/main/examples/highfreq) . ### Qlib Format Dataset[](https://qlib.readthedocs.io/en/latest/component/data.html#qlib-format-dataset "Permalink to this heading") `Qlib` has provided an off-the-shelf dataset in .bin format, users could use the script `scripts/get_data.py` to download the China-Stock dataset as follows. User can also use numpy to load .bin file to validate data. The price volume data look different from the actual dealing price because of they are **adjusted** ([adjusted price](https://www.investopedia.com/terms/a/adjusted_closing_price.asp) ). And then you may find that the adjusted price may be different from different data sources. This is because different data sources may vary in the way of adjusting prices. Qlib normalize the price on first trading day of each stock to 1 when adjusting them. Users can leverage $factor to get the original trading price (e.g. $close / $factor to get the original close price). Here are some discussions about the price adjusting of Qlib. * [https://github.com/microsoft/qlib/issues/991#issuecomment-1075252402](https://github.com/microsoft/qlib/issues/991#issuecomment-1075252402) \# download 1d python scripts/get\_data.py qlib\_data \--target\_dir ~/.qlib/qlib\_data/cn\_data \--region cn \# download 1min python scripts/get\_data.py qlib\_data \--target\_dir ~/.qlib/qlib\_data/qlib\_cn\_1min \--region cn \--interval 1min In addition to China-Stock data, `Qlib` also includes a US-Stock dataset, which can be downloaded with the following command: python scripts/get\_data.py qlib\_data \--target\_dir ~/.qlib/qlib\_data/us\_data \--region us After running the above command, users can find china-stock and us-stock data in `Qlib` format in the `~/.qlib/qlib_data/cn_data` directory and `~/.qlib/qlib_data/us_data` directory respectively. `Qlib` also provides the scripts in `scripts/data_collector` to help users crawl the latest data on the Internet and convert it to qlib format. When `Qlib` is initialized with this dataset, users could build and evaluate their own models with it. Please refer to [Initialization](https://qlib.readthedocs.io/en/latest/start/initialization.html) for more details. ### Automatic update of daily frequency data[](https://qlib.readthedocs.io/en/latest/component/data.html#automatic-update-of-daily-frequency-data "Permalink to this heading") > **It is recommended that users update the data manually once (--trading\_date 2021-05-25) and then set it to update automatically.** > > For more information refer to: [yahoo collector](https://github.com/microsoft/qlib/tree/main/scripts/data_collector/yahoo#Automatic-update-of-daily-frequency-data) > > * Automatic update of data to the “qlib” directory each trading day(Linux) > > * use _crontab_: crontab -e > > * set up timed tasks: > > \* \* \* \* 1\-5 python