diff --git a/static/index.html b/static/index.html
index b32bd035..80595079 100644
--- a/static/index.html
+++ b/static/index.html
@@ -1959,12 +1959,13 @@ async function loadStrategyList() {
}
}
+const ASC_DEFAULT = new Set(['max_dd']); // 回撤类:小=好,默认升序
function sortBy(key) {
if (window._sortKey === key) {
window._sortDir = window._sortDir === 'desc' ? 'asc' : 'desc';
} else {
window._sortKey = key;
- window._sortDir = 'desc';
+ window._sortDir = ASC_DEFAULT.has(key) ? 'asc' : 'desc';
}
renderStrategyTable(window._strats || []);
}
@@ -1988,7 +1989,7 @@ function sortStrategies(strategies, key, dir) {
case 'avg_profit': return st.avg_profit_pct != null ? st.avg_profit_pct : -999;
case 'sharpe': return st.sharpe_ratio != null ? st.sharpe_ratio : -999;
case 'profit_factor': return st.profit_factor != null ? st.profit_factor : -999;
- case 'max_dd': return pf.portfolio_max_dd_pct != null ? pf.portfolio_max_dd_pct : 999;
+ case 'max_dd': return (st.portfolio_full || pf).portfolio_max_dd_pct != null ? (st.portfolio_full || pf).portfolio_max_dd_pct : 999;
default: return 0;
}
};