feat: risk tier selector on Trading page + confidence filter on Recommendations
- Trading page: added conservative/moderate/aggressive selector that updates the trading engine config via PUT /api/trading/config - Recommendations page: added risk tier dropdown that defaults to the engine's current tier and filters recs by the tier's min_confidence - Backend: added min_confidence query param to GET /api/recommendations - Risk tier thresholds: conservative ≥0.75, moderate ≥0.55, aggressive ≥0.40
This commit is contained in:
@@ -299,12 +299,13 @@ export interface RecommendationDetail extends Recommendation {
|
||||
risk_evaluation: { id: string; eligible: boolean; allowed_mode: string; rejection_reasons: string[] | null; risk_checks: Record<string, unknown> | null; evaluated_at: string } | null;
|
||||
}
|
||||
|
||||
export function useRecommendations(params?: { ticker?: string; action?: string; mode?: string; since?: string; limit?: number; offset?: number }) {
|
||||
export function useRecommendations(params?: { ticker?: string; action?: string; mode?: string; since?: string; min_confidence?: number; limit?: number; offset?: number }) {
|
||||
const qs = new URLSearchParams();
|
||||
if (params?.ticker) qs.set('ticker', params.ticker);
|
||||
if (params?.action) qs.set('action', params.action);
|
||||
if (params?.mode) qs.set('mode', params.mode);
|
||||
if (params?.since) qs.set('since', params.since);
|
||||
if (params?.min_confidence != null) qs.set('min_confidence', String(params.min_confidence));
|
||||
if (params?.limit) qs.set('limit', String(params.limit));
|
||||
if (params?.offset) qs.set('offset', String(params.offset));
|
||||
const path = `/api/recommendations${qs.toString() ? '?' + qs : ''}`;
|
||||
|
||||
Reference in New Issue
Block a user