mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 15:44:18 +08:00
fix(backtest): cli _print_table used wrong key 'sharpe_ratio' instead of 'sharpe'
Performance dict outputs 'sharpe' but _print_table looked up 'sharpe_ratio',
so perf.get('sharpe_ratio', 0) always returned the default 0 regardless of
actual Sharpe value.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
46298e68d7
commit
70c69c8a66
@@ -182,7 +182,7 @@ def _print_table(result: Any) -> None:
|
||||
click.echo(f"总收益率: {perf.get('total_return', 0):.2%}")
|
||||
click.echo(f"年化收益: {perf.get('annual_return', 0):.2%}")
|
||||
click.echo(f"最大回撤: {perf.get('max_drawdown', 0):.2%}")
|
||||
click.echo(f"夏普比率: {perf.get('sharpe_ratio', 0):.2f}")
|
||||
click.echo(f"夏普比率: {perf.get('sharpe', 0):.2f}")
|
||||
click.echo(f"胜率: {perf.get('win_rate', 0):.2%}")
|
||||
click.echo(f"交易次数: {perf.get('total_trades', 0)}")
|
||||
click.echo()
|
||||
|
||||
Reference in New Issue
Block a user