feat: wavelets

This commit is contained in:
OpenSquared
2026-07-24 20:22:21 +02:00
parent 32f2d27782
commit 67d27eaeb6
5 changed files with 99 additions and 31 deletions

View File

@@ -81,13 +81,13 @@ def wavelet_cache(instrument_id: str) -> Dict[str, Any]:
agrees with the Signal card; "Start analyse" is still there for an on-demand live run
with custom parameters, which does NOT overwrite this cache.
Looked up by the Cockpit Watchlist ticker the cache is keyed on, normalized via the
same yfinance-suffix stripping instrument_service uses elsewhere (EURUSD=X -> EURUSD)
— a quick-added instrument's id already equals its Watchlist ticker verbatim, but a
curated one (EURUSD=X) doesn't."""
from services.instrument_service import _base_ticker
Looked up by the Cockpit Watchlist ticker the cache is keyed on, resolved via
instrument_service.resolve_watchlist_ticker — handles both the yfinance-suffix case
(EURUSD=X -> EURUSD) and the alias case where the catalog id and the Watchlist ticker
share no common substring at all (GC=F -> GOLD, ^GSPC -> SP500)."""
from services.instrument_service import resolve_watchlist_ticker
from services.database import get_wavelet_decomposition_cache
cached = get_wavelet_decomposition_cache(_base_ticker(instrument_id))
cached = get_wavelet_decomposition_cache(resolve_watchlist_ticker(instrument_id))
if not cached or not cached.get("decomposition"):
raise HTTPException(status_code=404, detail=f"Aucune décomposition wavelet en cache pour '{instrument_id}'")
return {