vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 7
声望: 3

qt.network.ssl: QSslSocket: cannot call unresolved function SSL_set_psk_use_session_callback
CThostFtdcUserApiImplBase::OnSessionDisconnected[0000026BCA6E9228][-1315700735][ 8193]
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_set_psk_use_session_callback
Exception in thread Thread-5:
Traceback (most recent call last):
File "C:\vnstudio\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "C:\vnstudio\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_backtester\engine.py", line 172, in run_backtesting
engine.run_backtesting()
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\backtesting.py", line 282, in run_backtesting
self.callback(data)
TypeError: 'NoneType' object is not callable

Administrator
avatar
加入于:
帖子: 4040
声望: 223

策略中需要先调用load_bar或者load_tick加载历史数据

Member
avatar
加入于:
帖子: 7
声望: 3

我用的是自带的atr_rsi_strategy.py 文件 下面应该 load_bar加载历史数据了?
def on_init(self):
"""
Callback when strategy is inited.
"""
self.write_log("策略初始化")

    self.rsi_buy = 50 + self.rsi_entry
    self.rsi_sell = 50 - self.rsi_entry

    self.load_bar(10)
Administrator
avatar
加入于:
帖子: 4040
声望: 223

这里的写法是加载了的

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