feat: Config tab "Options — Paramètres" with IV gate controls + exit params

- New tab replaces "Journal & Sortie" — consolidates all options-specific settings
- IV Gate section: toggle on/off + 3 sliders (IVR High/Extreme/Skew threshold)
  with live color-coded summary and interdependency guards (high < extreme)
- Exit params section: target, stop-loss, reversal mode + threshold (moved from removed journal tab)
- Backend: GET/PUT /api/config/options-gate endpoint reads/writes 4 config DB keys
- useApi.ts: useOptionsGate + useSaveOptionsGate hooks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OpenSquared
2026-06-20 10:23:31 +02:00
parent c7ccf237d7
commit 39da3b8945
3 changed files with 282 additions and 77 deletions

View File

@@ -459,6 +459,26 @@ export const useSaveExitDefaults = () => {
})
}
export const useOptionsGate = () =>
useQuery({
queryKey: ['options-gate-config'],
queryFn: () => api.get('/config/options-gate').then(r => r.data),
staleTime: 60_000,
})
export const useSaveOptionsGate = () => {
const qc = useQueryClient()
return useMutation({
mutationFn: (body: {
iv_gate_enabled?: boolean
iv_gate_ivr_high?: number
iv_gate_ivr_extreme?: number
iv_gate_skew_threshold?: number
}) => api.put('/config/options-gate', body).then(r => r.data),
onSuccess: () => qc.invalidateQueries({ queryKey: ['options-gate-config'] }),
})
}
export const useSimPortfolioRisk = () =>
useQuery({
queryKey: ['journal-portfolio-risk'],