feat: strategy builder
This commit is contained in:
@@ -1856,6 +1856,19 @@ export const useOptimizeStrategy = () =>
|
||||
api.post<OptimizeResponse>('/strategy-builder/optimize', body).then(r => r.data),
|
||||
})
|
||||
|
||||
// Day-by-day mark-to-market of a fixed set of legs against REAL accumulated Saxo history
|
||||
// between two dates — not a scenario, a replay of what actually happened.
|
||||
export type ReplayPoint = { date: string; spot: number | null; position_value: number; pnl: number }
|
||||
export type ReplayResult = {
|
||||
symbol: string; saxo_symbol: string; start_date: string; end_date: string
|
||||
entry_date: string; entry_value: number; final_pnl: number
|
||||
points: ReplayPoint[]; missing_dates: string[]
|
||||
}
|
||||
export const useReplayStrategy = () =>
|
||||
useMutation<ReplayResult, Error, { symbol: string; legs: StrategyLeg[]; start_date: string; end_date: string; contract_size?: number }>({
|
||||
mutationFn: (body) => api.post('/strategy-builder/replay', body).then(r => r.data),
|
||||
})
|
||||
|
||||
// Mode 1 of the scenario/profile/constraints split — what Greek behavior the scenario
|
||||
// alone already implies, before the user sets any explicit target (project memory:
|
||||
// Strategy Builder Greeks plan, Phase 4).
|
||||
|
||||
Reference in New Issue
Block a user