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

报错内容为: decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]

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 293, in run_backtesting
func(data)
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\backtesting.py", line 722, in new_bar
self.strategy.on_bar(bar)
File "D:\yxl _vny\strategies\demo_strategy.py", line 96, in on_bar
self.buy(print,1) #开多
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\template.py", line 155, in buy
return self.send_order(Direction.LONG, Offset.OPEN, price, volume, stop, lock)
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\template.py", line 189, in send_order
self, direction, offset, price, volume, stop, lock
File "C:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\backtesting.py", line 926, in send_order
price = round_to(price, self.pricetick)
File "C:\vnstudio\lib\site-packages\vnpy\trader\utility.py", line 124, in round_to
value = Decimal(str(value))
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]

[9784:328:0205/155753.810:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13
[9784:328:0205/155753.810:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13
[9784:328:0205/155753.913:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13
[9784:328:0205/155753.914:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13

Administrator
avatar
加入于:
帖子: 4228
声望: 241

self.buy(print,1)|

你的下单价格传了个print函数对象进去,必然报错了

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

谢谢!老师!

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