当前位置:网站首页>tutorial/detailed_workflow.ipynb 量化金融Qlib库
tutorial/detailed_workflow.ipynb 量化金融Qlib库
2022-07-28 20:32:00 【人工智能曾小健】
尽管用户可以基于 Qlib 的配置自动运行整个 Quant 研究工作流。
一些高级用户通常希望仔细定制每个组件以在 Quant 中进行更多探索。
如果您只想要一个简单的 Qlib 示例。快速入门和 workflow_by_code 可能是您更好的选择。
如果您想了解有关 Quant 研究的更多详细信息,此笔记本可能是您更好的起点。
我们希望这个脚本可以成为对 Quant 细节感兴趣的用户的教程。
本笔记本试图演示我们如何使用 Qlib 逐步构建组件。
from pprint import pprint
from pathlib import Path
import pandas as pdMARKET = "csi300"
BENCHMARK = "SH000300"
EXP_NAME = "tutorial_exp"用户可以按照以下步骤使用 CLI 下载数据。
在本例中,我们使用底层 API 自动下载数据
from qlib.tests.data import GetData
GetData().qlib_data(exists_skip=True)import qlib
qlib.init()检查原始数据
目前,Qlib 支持多种数据源。
from qlib.data import D
D.calendar(start_time='2010-01-01', end_time='2017-12-31', freq='day')[:2] # calendar data基本数据
df = D.features(['SH601216'], ['$open', '$high', '$low', '$close', '$factor'], start_time='2020-05-01', end_time='2020-05-31') import plotly.graph_objects as go
fig = go.Figure(data=[go.Candlestick(x=df.index.get_level_values("datetime"),
open=df['$open'],
high=df['$high'],
low=df['$low'],
close=df['$close'])])
fig.show()边栏推荐
- Written examination summary record
- Lvs+keepalived high availability deployment practical application
- 乌官员:乌克兰一半农产品经多瑙河港口出口
- array_ diff_ The method of not comparing array values when Assoc element is an array
- 内网渗透学习(三)域横向移动——计划任务
- Ukrainian officials: half of Ukrainian agricultural products are exported through the Danube port
- HCIP(9)
- Kubeedge releases white paper on cloud native edge computing threat model and security protection technology
- How does MySQL archive data?
- 【二叉树】二叉树中的伪回文路径
猜你喜欢
随机推荐
腾讯云数据库负责人借了一亿元炒股?知情人士:金额不实
[machine learning] naive Bayesian classification of text -- Classification of people's names and countries
ESP8266-Arduino编程实例-深度休眠与唤醒
HCIP(9)
What is a prime factor? In number theory, a prime factor (prime factor or prime factor) refers to a prime number that can divide a given positive integer
Typeof principle
Getting started with Oracle
迪赛智慧数——折线图(堆叠面积图):2022年不同职业人群存款额占月收入比例排名
HCIP(12)
HCIP(10)
Make trouble fishing day by day
Miscellaneous records of powersploit, evaluation, weevery and other tools in Kali
使用百度EasyDL实现明厨亮灶厨师帽识别
PCB材料简单介绍
Chapter 7: drawing rotating cubes
【机器学习】朴素贝叶斯对文本分类--对人名国别分类
Desai wisdom number - line chart (stacking area chart): ranking of deposits of different occupational groups in the proportion of monthly income in 2022
IFLYTEK written examination
hcip实验(15)
kubevela插件addons下载地址









