Merge pull request #1816 from 1122455801/portafolio_test_0610

[Add] cta投资组合回测示例
This commit is contained in:
vn.py 2019-06-11 11:10:56 +08:00 committed by GitHub
commit 1ba27ca5e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 230 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -330,9 +330,11 @@ class BacktestingEngine:
""""""
self.output("开始计算策略统计指标")
if not df:
# Check DataFrame input exterior
if df is None:
df = self.daily_df
# Check for init DataFrame
if df is None:
# Set all statistics to 0 if no trade.
start_date = ""
@ -476,9 +478,11 @@ class BacktestingEngine:
def show_chart(self, df: DataFrame = None):
""""""
if not df:
# Check DataFrame input exterior
if df is None:
df = self.daily_df
# Check for init DataFrame
if df is None:
return