掘金社区

第一次回测,找不到指定的程序Pinned highlighted

袁生 发表在问题反馈 2020-04-22 22:33:09

问题反馈
325
1
0

coding=utf-8

from future import print_function, absolute_import

from gm.api import *

def init(context):
# 每天14:55:20 定时执行algo任务
schedule(algo, '1d', '14:55:20')

def algo(context):
# 购买100股青岛啤酒股票
order_volume('SHSE.600600',100,1,2,1,0)

查看最终的回测结果

def on_backtest_finished(context, indicator):
print(indicator)

if name == 'main':
run(strategy_id='ad093090-849e-11ea-99cd-f8bc1259b01f',
filename='main.py',
mode=MODE_BACKTEST,
token='9059a45deb7e598a92bb5e69aff35c23e79ea242',
backtest_start_time='2018-02-28 09:30:00',
backtest_end_time='2019-02-28 15:00:00')

运行结果就是:

Traceback (most recent call last):
File "C:\Users\Administrator.goldminer3\projects\590a51ec-84a5-11ea-99cd-f8bc
1259b01f\main.py", line 4, in <module>
from gm.api import *
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\gm
api_init_.py", line 9, in <module>
from gm.csdk.c_sdk import py_gmi_set_version
File "c_sdk.pyx", line 10, in init c_sdk
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\gm
utils.py", line 15, in <module>
from google.protobuf.timestamp_pb2 import Timestamp
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\goo
gle\protobuf\timestamp_pb2.py", line 5, in <module>
from google.protobuf import descriptor as _descriptor
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\goo
gle\protobuf\descriptor.py", line 47, in <module>
from google.protobuf.pyext import _message
ImportError: DLL load failed: 找不到指定的程序。
请按任意键继续. . .

请问应如何处理才能出正确的结果?

评论: 1

Looks like your connection to 掘金量化社区 - 量化交易者的策略交流学习社区 was lost, please wait while we try to reconnect.