Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否以quantaxis为数据源实现一下 #9

Open
zhangshoug opened this issue May 30, 2019 · 4 comments
Open

能否以quantaxis为数据源实现一下 #9

zhangshoug opened this issue May 30, 2019 · 4 comments

Comments

@zhangshoug
Copy link

quantaxis数据存储在本地,有分钟、日线数据等.另问一个问题,rqalpha回测时默认是尾盘撮合,在尾盘涨停买不进,跌停卖不出。想改在开盘或其他时间撮合,有什么好方法实现

@BurdenBear
Copy link
Member

rqalpha关于怎么撮合的逻辑是写在一个sys_mod里的,应该是可以设置的,不过文档里好像没详细写,可能要去源码里找。

@BurdenBear
Copy link
Member

next_bar开盘撮合可以直接改设置,其他撮合逻辑可以仿照这个mod改
https://github.com/ricequant/rqalpha/tree/master/rqalpha/mod/rqalpha_mod_sys_simulation#%E6%A8%A1%E5%9D%97%E9%85%8D%E7%BD%AE%E9%A1%B9

@zhangshoug
Copy link
Author

开盘撮合已经弄好了,--signal 回测时指定使用信号模式,然后用限价单。data=QA.QAFetch.QAQuery_Advance.QA_fetch_stock_day_adv(code,'2013-01-01',Now)
df=data.data
open_price=df['open'][-1]
order_shares(buy_stock, 300,style=LimitOrder(open_price))
回测算是弄好了,能讲解下使用rqalpha在本地进行模拟交易或实盘交易的大致步骤么?

@BurdenBear
Copy link
Member

模拟交易,需要用rqalpha的撮合逻辑,就要参考rqalpha定义的数据源接口接入自有数据,本项目可以作为参考。
信号模式+限价单其实就是把撮合工作自己给实现了,没有交给引擎,那就看自己的需求来写了。
模拟交易,期货或许可以用simnow的模拟交易服务。
股票实盘可以参考: https://github.com/xingetouzi/rqalpha-mod-shipane-wrapper

rqalpha中的下单设计上不是事件驱动式的,不太好写一些精细的下单操作,建议只拿来生成信号,计算目标仓位,转发给其他的下单程序去执行具体的仓位建立工作。策略频率不高或者自己拿来跑交易的话,实盘易可能是一个可行的方案。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants