VeighNa量化社区
你的开源社区量化交易平台
Member
加入于:
帖子: 9
声望: 0

I have a trial rice quant account. I want to do backtesting and failed to load rice quant data on mac.
Can I use the account on vnpy mac? Do you have any quick guide for importing ricequant vnpy mac?

Member
avatar
加入于:
帖子: 101
声望: 8

kelly-yu wrote:

I have a trial rice quant account. I want to do backtesting and failed to load rice quant data on mac.
Can I use the account on vnpy mac? Do you have any quick guide for importing ricequant vnpy mac?
Please describe your error message in detail and preferably send a screenshot so that we know what happened

Member
加入于:
帖子: 9
声望: 0

description
有原 wrote:

kelly-yu wrote:

I have a trial rice quant account. I want to do backtesting and failed to load rice quant data on mac.
Can I use the account on vnpy mac? Do you have any quick guide for importing ricequant vnpy mac?
Please describe your error message in detail and preferably send a screenshot so that we know what happened

错误是这段代码呢,我用pip install 装了,都不成

Member
加入于:
帖子: 9
声望: 0

kelly-yu wrote:

description
有原 wrote:

kelly-yu wrote:

I have a trial rice quant account. I want to do backtesting and failed to load rice quant data on mac.
Can I use the account on vnpy mac? Do you have any quick guide for importing ricequant vnpy mac?
Please describe your error message in detail and preferably send a screenshot so that we know what happened

错误是这段代码呢,我用pip install 装了,都不成

description
我是要下载这些数据

Member
加入于:
帖子: 9
声望: 0

kelly-yu wrote:

kelly-yu wrote:

description
有原 wrote:

kelly-yu wrote:

I have a trial rice quant account. I want to do backtesting and failed to load rice quant data on mac.
Can I use the account on vnpy mac? Do you have any quick guide for importing ricequant vnpy mac?
Please describe your error message in detail and preferably send a screenshot so that we know what happened

错误是这段代码呢,我用pip install 装了,都不成

description
我是要下载这些数据

用pip 安装的命令

description

Member
avatar
加入于:
帖子: 101
声望: 8

RqData已经剥离了,同时database_manager也不在vnpy.trader.database下了,所以可以把代码修改为:

from vnpy_rqdata import radata_client
from vnpy.trader.database import get_database
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.object import HistoryRequest

database_manager = get_database()

下同
Member
加入于:
帖子: 9
声望: 0

有原 wrote:

RqData已经剥离了,同时database_manager也不在vnpy.trader.database下了,所以请把代码修改为:

from vnpy_rqdata import radata_client
from vnpy.trader.database import get_database
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.object import HistoryRequest

database_manager = get_database()

下同

description

改成这样依旧不行呢

Member
avatar
加入于:
帖子: 3171
声望: 216
  1. 没看见你database_manager = get_database()这句代码;
  2. 是rqdata_client
Member
加入于:
帖子: 9
声望: 0

description

改了,不行呢

Super Moderator
avatar
加入于:
帖子: 529
声望: 43

from vnpy.trader.database import get_datafeed
from vnpy.trader.database import get_database
from vnpy.trader.constant import Exchange, Interval
from vnpy.trader.object import HistoryRequest

database_manager = get_database()
datafeed = get_datafeed()

下面使用datafeed取代rqdata_client, 还有代码改的时候请仔细一些,你只是改了import内容,没有改from后面的内容

Super Moderator
avatar
加入于:
帖子: 47
声望: 2

from vnpy.trader.object import HistoryRequest
from vnpy.trader.utility import extract_vt_symbol
from vnpy.trader.constant import Exchange, Interval
from vnpy_rqdata.rqdata_datafeed import RqdataDatafeed
from vnpy_mysql.mysql_database import MysqlDatabase
from datetime import datetime

start_date = datetime(2018,1,1)
end_date = datetime(2021,11,1)

symbols = {
"SHFE": ["CU", "AL", "ZN", "PB", "NI", "SN", "AU", "AG", "RB", "WR", "HC", "SS", "BU", "RU", "NR", "SP", "SC", "LU", "FU"],
"DCE": ["C", "CS", "A", "B", "M", "Y", "P", "FB","BB", "JD", "RR", "L", "V", "PP", "J", "JM", "I", "EG", "EB", "PG"],
"CZCE": ["SR", "CF", "CY", "PM","WH", "RI", "LR", "AP","JR","OI", "RS", "RM", "TA", "MA", "FG", "SF", "ZC", "SM", "UR", "SA", "CL"],
"CFFEX": ["IH","IC","IF", "TF","T", "TS"]
}

symbol_type = "888"

rqfeed = RqdataDatafeed()
sqdb = MysqlDatabase()

def load_data(req):
data = rqfeed.query_bar_history(req)
sqdb.save_bar_data(data)
print(f"{req.symbol}历史数据下载完成")

for exchange, symbols_list in symbols.items():
for s in symbols_list:
req = HistoryRequest(
symbol=s+symbol_type,
exchange=Exchange(exchange),
start=start_date,
interval=Interval.MINUTE,
end=end_date,
)
load_data(req=req)
print("运行结束!")

Member
avatar
加入于:
帖子: 5
声望: 0

RQ小助手 wrote:

linzihao wrote:

rqdatac.share.errors.PermissionDenied: this license is only allowed to access through the education network这个是什么问题明明连的是校园网
麻烦提供一下IP地址,以及学校的名称
私信你了

Super Moderator
avatar
加入于:
帖子: 47
声望: 2

linzihao wrote:

RQ小助手 wrote:

linzihao wrote:

rqdatac.share.errors.PermissionDenied: this license is only allowed to access through the education network这个是什么问题明明连的是校园网
麻烦提供一下IP地址,以及学校的名称
私信你了
已经添加该网段,24小时后可用

Member
avatar
加入于:
帖子: 1
声望: 0

我已经输入了密钥,为什么导入库还是会显示这个。
description

description

Member
avatar
加入于:
帖子: 5
声望: 0

我在进行设置好之后,我发现只能下载原油的历史数据,别的历史数据都显示下载失败
description

Super Moderator
avatar
加入于:
帖子: 529
声望: 43

开始时间和结束时间设置有没有进行修改,我看你图里是19-20年的。

© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】