求教大神:
我用的是无界面的,信号能正常触发,之前已经用 ‘simnow仿真交易账号’ 能正常交易的,可是实盘它就为什么不能成功交易呢,我现在的截图是加了lock=True 的,之前是没有加lock=True的,难道是实盘必需加lock=True才能正常成交的是吗?
UI界面刷新数据时就报下面的错:
Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnpy\app\data_manager\ui\widget.py", line 191, in refresh_tree
item.setText(5, d["start"].strftime("%Y-%m-%d %H:%M:%S"))
AttributeError: 'str' object has no attribute 'strftime'
回测时数据的datetime时间后面多了个 +08:06 :
BarData(gateway_name='DB', symbol='ag2102', exchange=<Exchange.SHFE: 'SHFE'>, datetime='2020-07-23 00:18:00+08:06', interval=<Interval.MINUTE: '1m'>, volume=12.0, open_interest=13804.0, open_price=5347.0, high_price=5358.0, low_price=5347.0, close_price=5358.0)
2020-07-23 00:20:28.770425 触发异常,回测终止
2020-07-23 00:20:28.786070 Traceback (most recent call last):
File "C:\vnstudio\Lib\site-packages\vnpy\app\cta_strategy\backtesting.py", line 288, in run_backtesting
self.callback(data)
File "C:/vnstudio/Lib/site-packages/vnpy/app/cta_strategy/strategies/haigui_2.py", line 80, in on_bar
self.bg.update_bar(bar)
File "C:\vnstudio\Lib\site-packages\vnpy\trader\utility.py", line 254, in update_bar
dt = bar.datetime.replace(minute=0, second=0, microsecond=0)
TypeError: replace() takes no keyword arguments
请问大神们这个要怎么弄,求指点,等着用,不胜感激···
请问各位同学 回测和实盘的多空仓位信息怎么提取