Closed synote closed 2 years ago
The backtester gives the runtime error:
RuntimeWarning: divide by zero encountered in double_scalars return_drawdown_ratio: float = -total_return / max_ddpercent
This is due to the max_ddpercent may be 0 in some kind of trading.
max_ddpercent
We can just assign return_drawdown_ratio=0 if the max_ddpercent is 0. This can avoid runtime waning.
已修复 https://github.com/vnpy/vnpy_ctastrategy/pull/18
The backtester gives the runtime error:
This is due to the
max_ddpercent
may be 0 in some kind of trading.We can just assign return_drawdown_ratio=0 if the max_ddpercent is 0. This can avoid runtime waning.