SixQuant / Rqalpha Data
Licence: mit
A utility for RQAlpha to directly use data(不需要在回测里而是直接调用 RQAlpha 的数据)
Stars: ✭ 37
Programming Languages
python
139335 projects - #7 most used programming language
Labels
Projects that are alternatives of or similar to Rqalpha Data
Awesome Quant
A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)
Stars: ✭ 8,205 (+22075.68%)
Mutual labels: quant
Awesome Ai In Finance
🔬 A curated list of awesome machine learning strategies & tools in financial market.
Stars: ✭ 910 (+2359.46%)
Mutual labels: quant
Pylivetrader
Python live trade execution library with zipline interface.
Stars: ✭ 470 (+1170.27%)
Mutual labels: quant
Quantaxis
QUANTAXIS 支持任务调度 分布式部署的 股票/期货/期权/港股/虚拟货币 数据/回测/模拟/交易/可视化/多账户 纯本地量化解决方案
Stars: ✭ 6,136 (+16483.78%)
Mutual labels: quant
Strategyease Python Sdk
策略易(StrategyEase)Python SDK,策略自动化交易 API 及量化平台。
Stars: ✭ 741 (+1902.7%)
Mutual labels: quant
Trady
Trady is a handy library for computing technical indicators, and it targets to be an automated trading system that provides stock data feeding, indicator computing, strategy building and automatic trading. It is built based on .NET Standard 2.0.
Stars: ✭ 433 (+1070.27%)
Mutual labels: quant
Qlib
Qlib is an AI-oriented quantitative investment platform, which aims to realize the potential, empower the research, and create the value of AI technologies in quantitative investment. With Qlib, you can easily try your ideas to create better Quant investment strategies. An increasing number of SOTA Quant research works/papers are released in Qlib.
Stars: ✭ 7,582 (+20391.89%)
Mutual labels: quant
Quantstats
Portfolio analytics for quants, written in Python
Stars: ✭ 823 (+2124.32%)
Mutual labels: quant
Quantdom
Python-based framework for backtesting trading strategies & analyzing financial markets [GUI ]
Stars: ✭ 449 (+1113.51%)
Mutual labels: quant
Rqalpha
A extendable, replaceable Python algorithmic backtest && trading framework supporting multiple securities
Stars: ✭ 4,425 (+11859.46%)
Mutual labels: quant
Sgx Full Orderbook Tick Data Trading Strategy
Providing the solutions for high-frequency trading (HFT) strategies using data science approaches (Machine Learning) on Full Orderbook Tick Data.
Stars: ✭ 733 (+1881.08%)
Mutual labels: quant
Quant Finance Resources
Courses, Articles and many more which can help beginners or professionals.
Stars: ✭ 36 (-2.7%)
Mutual labels: quant
RQAlpha-Data
Overview
A utility for RQAlpha to directly use data.
不需要在回测里而是直接调用 RQAlpha 的数据。
对 history_bars 函数进行一定包装后变成 get_bars 函数,以便直接在 Jupyter 中直接使用!
匆忙写就,欢迎各位提问题以便改进它,当然更欢迎给我加个 Star。
最终效果:
常用的函数:
-
is_trading_date 判断是否是交易日
-
get_trading_dates - 交易日列表
-
get_previous_trading_date - 上一交易日
-
get_next_trading_date - 下一交易日
-
is_suspended - 全天停牌判断
-
is_st_stock - ST股判断
-
get_prev_close
-
get_bar 和RQAlpha兼容
-
history 和RQAlpha兼容
-
history_bars 和RQAlpha兼容
-
get_bars 推荐使用
(注意:如果中间有停牌日期,则自动跳过,保证最后数据行数为 bar_count = 5 个)
field 字段名 open 开盘价 high 最高价 low 最低价 close 收盘价 volume 成交量 total_turnover 成交额 datetime 时间
get_bars(order_book_id,
dt,
bar_count=1,
frequency='1d',
fields=None,
skip_suspended=True,
include_now=False,
adjust_type='pre',
adjust_orig=None,
convert_to_dataframe=False)
Install
Install rqalpha
$ pip install rqalpha
Install rqalpha-data
$ pip install rqalpha-data
Quick Start
数据更新
如果第一次使用或想要更新数据,请调用 update 方法
from rqalpha_data import datasource
datasource.update()
get_bars
- 获取单支股票,返回格式为数组
from rqalpha_data import *
df = get_bars('600469.XSHG', '2017-11-01', 5, fields=['datetime', 'open', 'close'])
print(df)
输出(注意:如果中间有停牌日期,则自动跳过,保证最后数据行数为 bar_count = 5 个)
[(20171025000000L, 8.09, 8.16) (20171026000000L, 8.16, 8.18)
(20171027000000L, 8.17, 8.11) (20171030000000L, 8.11, 7.98)
(20171101000000L, 7.88, 7.44)]
- 获取单支股票,返回格式为DataFrame
from rqalpha_data import *
df = get_bars('600469.XSHG', '2017-11-01', 5, fields=['datetime', 'open', 'close'], convert_to_dataframe=True)
print(df)
输出(注意:如果中间有停牌日期,则自动跳过,保证最后数据行数为 bar_count = 5 个)
open close
2017-10-25 8.09 8.16
2017-10-26 8.16 8.18
2017-10-27 8.17 8.11
2017-10-30 8.11 7.98
2017-11-01 7.88 7.44
如何在 Jupyter 中使用 rqalpha 进行回测
有的朋友可能不知道如何在 Jupyter 中使用 rqalpha 进行回测
License
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].