Add activation thresholds: qualified-signal defaults and views
Deploy / lint (push) Successful in 7s
Deploy / test (push) Successful in 32s
Deploy / deploy (push) Successful in 24s

Admin-configurable thresholds (min R:R, default 2.0; min confidence,
default 70%) defining what counts as an actionable signal:

- Admin Settings: new Activation Thresholds panel
  (GET/PUT /admin/settings/activation)
- GET /trades/activation exposes values to all users with access
- Signals/Setups: filters initialize from activation values
- Track Record: "Qualified signals only" toggle (default on) via
  min_rr/min_confidence params on /trades/performance; the
  confidence breakdown always covers the full population so the
  thresholds can be validated against outcomes
- Dashboard: "Qualified" metric and qualified-first Top Setups
- Outcome evaluator unchanged: every setup is still evaluated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 18:16:04 +02:00
co-authored by Claude Fable 5
parent d139dd0390
commit 6da65b8d8f
20 changed files with 440 additions and 29 deletions
+10
View File
@@ -0,0 +1,10 @@
import { useQuery } from '@tanstack/react-query';
import { getActivation } from '../api/activation';
export function useActivation() {
return useQuery({
queryKey: ['activation'],
queryFn: getActivation,
staleTime: 5 * 60 * 1000,
});
}
+26
View File
@@ -114,6 +114,32 @@ export function useUpdateRecommendationSettings() {
});
}
export function useActivationSettings() {
return useQuery({
queryKey: ['admin', 'activation-settings'],
queryFn: () => adminApi.getActivationSettings(),
});
}
export function useUpdateActivationSettings() {
const qc = useQueryClient();
const { addToast } = useToast();
return useMutation({
mutationFn: (payload: Record<string, number>) =>
adminApi.updateActivationSettings(payload),
onSuccess: () => {
qc.invalidateQueries({ queryKey: ['admin', 'activation-settings'] });
qc.invalidateQueries({ queryKey: ['activation'] });
qc.invalidateQueries({ queryKey: ['performance'] });
addToast('success', 'Activation thresholds updated');
},
onError: (error: Error) => {
addToast('error', error.message || 'Failed to update activation thresholds');
},
});
}
export function useTickerUniverseSetting() {
return useQuery({
queryKey: ['admin', 'ticker-universe'],
+4 -4
View File
@@ -1,9 +1,9 @@
import { useQuery } from '@tanstack/react-query';
import { getPerformance } from '../api/performance';
import { getPerformance, type PerformanceParams } from '../api/performance';
export function usePerformance() {
export function usePerformance(params?: PerformanceParams) {
return useQuery({
queryKey: ['performance'],
queryFn: getPerformance,
queryKey: ['performance', params ?? null],
queryFn: () => getPerformance(params),
});
}