Require aligned action for qualified setups
This commit is contained in:
@@ -76,15 +76,12 @@ export default function DashboardPage() {
|
||||
[trades.data, activation.data],
|
||||
);
|
||||
|
||||
// Show qualified setups first; fall back to the full list when none qualify.
|
||||
// Rank by residual 12-1 momentum percentile so the strongest names sit at the top.
|
||||
const showingQualified = qualifiedSetups.length > 0;
|
||||
// Rank only actionable/qualified setups by residual 12-1 momentum percentile.
|
||||
const topSetups: TradeSetup[] = useMemo(() => {
|
||||
const pool = showingQualified ? qualifiedSetups : trades.data ?? [];
|
||||
return [...pool]
|
||||
return [...qualifiedSetups]
|
||||
.sort((a, b) => (b.momentum_percentile ?? -Infinity) - (a.momentum_percentile ?? -Infinity))
|
||||
.slice(0, 5);
|
||||
}, [showingQualified, qualifiedSetups, trades.data]);
|
||||
}, [qualifiedSetups]);
|
||||
|
||||
const topWatchlist = useMemo(
|
||||
() =>
|
||||
@@ -197,12 +194,12 @@ export default function DashboardPage() {
|
||||
<div className="xl:col-span-3">
|
||||
<Section
|
||||
title="Top Setups"
|
||||
hint={showingQualified ? 'ranked by expected value' : 'none qualified — showing all'}
|
||||
hint="qualified and ranked by residual momentum"
|
||||
>
|
||||
{trades.isLoading && <SkeletonTable rows={5} cols={5} />}
|
||||
{trades.isError && <Callout variant="error">Failed to load setups</Callout>}
|
||||
{trades.data && topSetups.length === 0 && (
|
||||
<Callout variant="empty">No active setups. Run the scanner from the Signals page.</Callout>
|
||||
<Callout variant="empty">No qualified actionable setups right now.</Callout>
|
||||
)}
|
||||
{topSetups.length > 0 && (
|
||||
<div className="glass overflow-x-auto">
|
||||
|
||||
Reference in New Issue
Block a user