fix: align production defaults and close review parity gaps

Ship greenfield min_rr=2.0 and conf=0, read-only Structural S/R, indicator
cache invalidation, and UI/gate language that treats GTL as screening not exit.
Align strategy_rank missing-vol fallback live vs backtest, single-source
PRIMARY_TARGET_MIN_RR, expand prod parity tests, and drop dead FE clients.
This commit is contained in:
2026-07-18 13:03:22 +02:00
parent e07da0f8f0
commit b0e33e1606
25 changed files with 429 additions and 221 deletions
@@ -44,6 +44,10 @@ function getComputedValue(trade: TradeSetup, column: SortColumn): number {
case 'confidence_score': return trade.confidence_score ?? -1;
case 'primary_target_probability':
return primaryTargetProbability(trade) ?? -1;
case 'strategy_rank':
return trade.strategy_rank ?? trade.momentum_percentile ?? -1;
case 'momentum_percentile':
return trade.momentum_percentile ?? -1;
case 'risk_level':
if (trade.risk_level === 'Low') return 1;
if (trade.risk_level === 'Medium') return 2;
@@ -79,6 +83,8 @@ function sortTrades(
case 'target_pct':
case 'confidence_score':
case 'primary_target_probability':
case 'strategy_rank':
case 'momentum_percentile':
case 'risk_level':
cmp = getComputedValue(a, column) - getComputedValue(b, column);
break;
@@ -108,7 +114,8 @@ export function SetupsPanel() {
const [minConfidence, setMinConfidence] = useState(0);
const [directionFilter, setDirectionFilter] = useState<DirectionFilter>('both');
const [actionFilter, setActionFilter] = useState<ActionFilter>('all');
const [sortColumn, setSortColumn] = useState<SortColumn>('rr_ratio');
// Production book orders by 80/20 strategy_rank, not raw R:R.
const [sortColumn, setSortColumn] = useState<SortColumn>('strategy_rank');
const [sortDirection, setSortDirection] = useState<SortDirection>('desc');
// Keep the Min R:R / Min Confidence inputs showing the *effective* floor: when
@@ -244,10 +251,11 @@ export function SetupsPanel() {
<Disclosure summary="How the scanner works & action glossary">
<p className="mb-3 text-xs text-gray-400">
The scanner identifies asymmetric risk-reward trade setups by analyzing S/R levels as
price targets and using ATR-based stops to define risk. Click{' '}
<span className="font-medium text-gray-300">Run Scanner</span> to scan all tickers now,
or wait for the scheduled run.
The scanner builds long setups with a 1.5× ATR stop and a Gate Target Ladder proposal used
only for R:R / reach-probability screening not as a take-profit. Structural chart S/R is
separate. Live exit is the ATR trail / max hold. Click{' '}
<span className="font-medium text-gray-300">Run Scanner</span> to scan all tickers now, or
wait for the scheduled run.
</p>
<div className="grid gap-1 md:grid-cols-2">
{RECOMMENDATION_ACTION_GLOSSARY.map((item) => (