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:
1 parent
e07da0f8f0
commit
b0e33e1606
25 files changed
+429
-221
No files matched your search
@@ -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) => (
|
||||
|
||||
@@ -109,19 +109,19 @@ export function TrackRecordPanel() {
|
||||
<Disclosure summary="Track-record maintenance">
|
||||
<div className="space-y-4 pt-1">
|
||||
<p className="max-w-2xl text-xs text-gray-500">
|
||||
The live check replays every setup against the daily bars after detection: target before stop =
|
||||
win, stop first = loss (both in one bar counts conservatively as a loss), neither within 30
|
||||
trading days = expired at 0R. Only setups whose full window has elapsed count; younger ones are
|
||||
still maturing (near stops resolve fast, far targets need time, so early numbers skew negative).
|
||||
The evaluator scores <span className="text-gray-300">all</span> setups — qualified or not, so
|
||||
unqualified ones stay a control group — and runs nightly.
|
||||
<span className="text-amber-300/90">Diagnostic only — not production P&L.</span>{' '}
|
||||
Grades gate-level touch vs stop (the rejected take-profit model). Production exits are
|
||||
initial stop / ATR trail / max hold — see paper trades and the portfolio monitor above.
|
||||
Target before stop = win, stop first = loss (same-bar both = loss), neither in 30 trading
|
||||
days = expired at 0R. Only matured windows count. Scores{' '}
|
||||
<span className="text-gray-300">all</span> setups as a control group; runs nightly.
|
||||
</p>
|
||||
|
||||
{/* Diagnostic, not strategy validation: live target/stop outcomes vs the backtest's target/stop model. */}
|
||||
<div className="glass-sm space-y-2 p-4">
|
||||
<div className="flex flex-wrap items-center justify-between gap-x-6 gap-y-2">
|
||||
<div className="flex flex-wrap items-baseline gap-x-5 gap-y-1">
|
||||
<span className="text-sm text-gray-300">Setup-outcome pipeline check</span>
|
||||
<span className="text-sm text-gray-300">Gate barrier pipeline check</span>
|
||||
<span className="text-sm text-gray-400">
|
||||
Live <span className={`num font-semibold ${rColor(liveAvgR)}`}>{fmtR(liveAvgR)}</span>
|
||||
</span>
|
||||
@@ -129,7 +129,7 @@ export function TrackRecordPanel() {
|
||||
Backtest <span className={`num font-semibold ${rColor(btAvgR)}`}>{fmtR(btAvgR)}</span>
|
||||
</span>
|
||||
<span className="text-xs text-gray-500">
|
||||
{liveN} matured{perf ? ` · ${perf.maturing} maturing` : ''} · qualified target/stop
|
||||
{liveN} matured{perf ? ` · ${perf.maturing} maturing` : ''} · not ATR-trail book
|
||||
</span>
|
||||
</div>
|
||||
<StatusChip status={status} />
|
||||
|
||||
Reference in new issue
Block a user