[Fix]Close #1035
This commit is contained in:
parent
97bfabe191
commit
cd1d939c58
@ -615,6 +615,11 @@ class BacktestingEngine(object):
|
|||||||
"""
|
"""
|
||||||
self.output(u'计算回测结果')
|
self.output(u'计算回测结果')
|
||||||
|
|
||||||
|
# 检查成交记录
|
||||||
|
if not self.tradeDict:
|
||||||
|
self.output(u'成交记录为空,无法计算回测结果')
|
||||||
|
return {}
|
||||||
|
|
||||||
# 首先基于回测后的成交记录,计算每笔交易的盈亏
|
# 首先基于回测后的成交记录,计算每笔交易的盈亏
|
||||||
resultList = [] # 交易结果列表
|
resultList = [] # 交易结果列表
|
||||||
|
|
||||||
@ -971,6 +976,11 @@ class BacktestingEngine(object):
|
|||||||
"""计算按日统计的交易结果"""
|
"""计算按日统计的交易结果"""
|
||||||
self.output(u'计算按日统计结果')
|
self.output(u'计算按日统计结果')
|
||||||
|
|
||||||
|
# 检查成交记录
|
||||||
|
if not self.tradeDict:
|
||||||
|
self.output(u'成交记录为空,无法计算回测结果')
|
||||||
|
return {}
|
||||||
|
|
||||||
# 将成交添加到每日交易结果中
|
# 将成交添加到每日交易结果中
|
||||||
for trade in self.tradeDict.values():
|
for trade in self.tradeDict.values():
|
||||||
date = trade.dt.date()
|
date = trade.dt.date()
|
||||||
|
Loading…
Reference in New Issue
Block a user