feat: trade mandate (budget + horizon) wired end-to-end
- database.py: add trade_budget_eur / preferred_horizon_min/max config defaults and include them in cycle config migrations - auto_cycle.py: read trade params from config and inject into cycle_meta - ai_analyzer.py: inject INVESTOR TRADE MANDATE block into scoring and suggestion prompts so GPT-4o penalises horizon mismatches and sizes within the capital cap - Config.tsx: Trade Parameters card with budget + horizon sliders and live mandate summary - TradeIdeas.tsx: horizon filter pills (< 1M / 1-3M / 3-6M / > 6M) and budget/horizon indicator pulled from saved config - useApi.ts: extend useUpdateCycleConfig type with new config fields Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -337,7 +337,7 @@ export const useCycleHistory = (limit = 20) =>
|
||||
export const useUpdateCycleConfig = () => {
|
||||
const qc = useQueryClient()
|
||||
return useMutation({
|
||||
mutationFn: (cfg: { enabled?: boolean; interval_hours?: number; similarity_threshold?: number; min_ev_threshold?: number; min_score_threshold?: number; journal_retention_days?: number; maturity_threshold_pct?: number; weekend_cycle_enabled?: boolean; weekend_cycle_times?: string }) =>
|
||||
mutationFn: (cfg: { enabled?: boolean; interval_hours?: number; similarity_threshold?: number; min_ev_threshold?: number; min_score_threshold?: number; trade_budget_eur?: number; preferred_horizon_min?: number; preferred_horizon_max?: number; journal_retention_days?: number; maturity_threshold_pct?: number; weekend_cycle_enabled?: boolean; weekend_cycle_times?: string }) =>
|
||||
api.post('/cycle/config', cfg).then(r => r.data),
|
||||
onSuccess: () => qc.invalidateQueries({ queryKey: ['cycle-status'] }),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user