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:
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user