feat: instrument analysis

This commit is contained in:
OpenSquared
2026-07-23 22:28:56 +02:00
parent 548bad2dcd
commit e0c4aa8f65
9 changed files with 2395 additions and 307 deletions

View File

@@ -200,6 +200,17 @@ export const useSetWatchlistSaxoQuoteLink = () => {
})
}
// Links an Instrument Analysis instrument (backend/config/instruments.json — a separate
// catalog from instruments_watchlist above) to a Saxo quote symbol, so its chart/indicators/
// wavelets are Saxo-sourced instead of yfinance. InstrumentDashboard.tsx doesn't use React
// Query for its own data (plain axios + useState), so this mutation carries no
// invalidateQueries — the caller re-fetches the instrument list/snapshot itself on success.
export const useSetInstrumentSaxoLink = () =>
useMutation({
mutationFn: ({ instrumentId, saxoSymbol }: { instrumentId: string; saxoSymbol: string | null }) =>
api.put(`/instruments/${encodeURIComponent(instrumentId)}/saxo-link`, { saxo_symbol: saxoSymbol }).then(r => r.data),
})
// Free-form display name — no longer tied to yfinance's long_name lookup, since an
// instrument can now be entirely Saxo-sourced.
export const useRenameWatchlistInstrument = () => {