当前位置:网站首页>tutorial/detailed_workflow.ipynb 量化金融Qlib库
tutorial/detailed_workflow.ipynb 量化金融Qlib库
2022-07-29 15:58: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()边栏推荐
猜你喜欢

ByteArrayOutputStream 类源码分析
![[PCL study notes] Commonly used libraries and APIs for point cloud processing (PCL library Eigen)](/img/b6/0f6113109aef776c777cb25a0ffb95.png)
[PCL study notes] Commonly used libraries and APIs for point cloud processing (PCL library Eigen)

可行性研究报告模板

揭秘 | 2019 To B 年度盛宴那些人和那些事

Contribution and writing required documents - OpenHarmony developer documentation style guide

打卡广汽本田喜悦安全驾驶中心,体验最刁钻的场地训练

zabbix email sends alert information

MySQL数据库安装配置保姆级教程(以8.0.29为例)有手就行

zabbix邮件发送告警信息

大规模线上应用TiDB会遇到的坑,本文都帮你排除好了
随机推荐
Property (Property Animation Animation), the basic use of Butterknife butter knife
[PCL study notes] Commonly used libraries and APIs for point cloud processing (PCL library Eigen)
【微信小程序】组件使用及属性参考
SAP ABAP OData 服务诊断工具 /IWFND/ERROR_LOG 的使用方法试读版
闻泰科技拟收购欧菲光摄像头业务资产,或将进入苹果供应链!
中芯国际:禁令后全力自救,设备等待期拉长,但没有客户“离开”
揭秘 | 2019 To B 年度盛宴那些人和那些事
nacos实现基本的服务跨进程调用和使用OpenFeign进行服务跨进程调用
CAS原理以及ABA问题解决Demo-代码
如何写好设计文档
【小程序项目开发-- 京东商城】uni-app之商品列表页面 (上)
Jenkins 如何玩转接口自动化测试?
边缘计算如何与小程序结合?智能家居如何借势发展?
Ribbon自定义修改负载均衡
错排问题详解
地平线获得舜宇集团战略投资并与舜宇智领签署战略合作协议
Interviewer: What are the design principles?What is the Lie Substitution Principle?
面试突击69:TCP 可靠吗?为什么?
MySQL外键约束怎么创建
设置工作模式与环境