Skip to content

Commit

Permalink
修复无交易记录时展示买卖点的异常
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhou-JiaJun committed Nov 8, 2022
1 parent 23bc765 commit 5ff2197
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rqalpha/mod/rqalpha_mod_sys_analyser/plot/plot.py
Expand Up @@ -197,7 +197,7 @@ def plot_result(result_dict, show=True, save=None, weekly_indicators: bool = Fal
([max_dd.start, max_dd.end], MAX_DD),
([max_ddd.start, max_ddd.end], MAX_DDD)
]
if open_close_points:
if open_close_points and not result_dict["trades"].empty:
trades: pd.DataFrame = result_dict["trades"]
spots_on_returns.append((trading_dates_index(trades, POSITION_EFFECT.CLOSE, portfolio.index), CLOSE_POINT))
spots_on_returns.append((trading_dates_index(trades, POSITION_EFFECT.OPEN, portfolio.index), OPEN_POINT))
Expand Down

0 comments on commit 5ff2197

Please sign in to comment.