Merge pull request #1816 from 1122455801/portafolio_test_0610
[Add] cta投资组合回测示例
This commit is contained in:
commit
1ba27ca5e3
223
tests/backtesting/backtesting_portfolio.ipynb
Normal file
223
tests/backtesting/backtesting_portfolio.ipynb
Normal file
File diff suppressed because one or more lines are too long
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user