Improve expectancy output to include ratio

This commit is contained in:
Matthias 2023-07-22 19:48:04 +02:00
parent f7516ee4ab
commit c89218ebd2
2 changed files with 10 additions and 2 deletions

View File

@ -169,9 +169,16 @@ const backtestResultStats = computed(() => {
value: `${props.backtestResult.calmar ? props.backtestResult.calmar.toFixed(2) : 'N/A'}`,
},
{
metric: 'Expectancy',
metric: `Expectancy ${props.backtestResult.expectancy_ratio ? '(ratio)' : ''}`,
value: `${
props.backtestResult.expectancy ? props.backtestResult.expectancy.toFixed(2) : 'N/A'
props.backtestResult.expectancy
? props.backtestResult.expectancy_ratio
? props.backtestResult.expectancy.toFixed(2) +
' (' +
props.backtestResult.expectancy_ratio.toFixed(2) +
')'
: props.backtestResult.expectancy.toFixed(2)
: 'N/A'
}`,
},
{

View File

@ -162,6 +162,7 @@ export interface StrategyBacktestResult {
sharpe?: number;
calmar?: number;
expectancy?: number;
expectancy_ratio?: number;
winner_holding_avg: string;
winner_holding_avg_s: number;