Add activation thresholds: qualified-signal defaults and views
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:
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user