Commit Graph

73 Commits

Author SHA1 Message Date
OpenSquared
d85c0348d8 feat: strategy builder 2026-07-30 13:51:15 +02:00
OpenSquared
81165581d7 feat: strategy builder 2026-07-30 13:28:03 +02:00
OpenSquared
1c4d8013c4 feat: strategy builder 2026-07-30 11:30:59 +02:00
OpenSquared
15528e0c98 feat: backtest 2026-07-30 10:53:47 +02:00
OpenSquared
9a2ffb1c6a feat: backtest 2026-07-29 21:35:30 +02:00
OpenSquared
d2c393b8e5 feat: option lab 2026-07-28 11:14:31 +02:00
OpenSquared
568414ca0c feat: strategy builder 2026-07-27 18:58:02 +02:00
OpenSquared
3704724b0b feat: risk 2026-07-26 14:10:49 +02:00
OpenSquared
ad7ab35d1d feat: curve regime 2026-07-25 09:23:26 +02:00
OpenSquared
adfe520863 feat: wavelets 2026-07-24 16:14:06 +02:00
OpenSquared
a2e770aac9 feat: cockpit 2026-07-24 12:23:14 +02:00
OpenSquared
35a00f43c3 feat: cockpit 2026-07-24 11:46:37 +02:00
OpenSquared
2e5326f8bf feat: cockpit 2026-07-24 10:33:35 +02:00
OpenSquared
e0c4aa8f65 feat: instrument analysis 2026-07-23 22:28:56 +02:00
OpenSquared
548bad2dcd feat: cockpit 2026-07-23 22:04:02 +02:00
OpenSquared
9cf3086254 feat; cockpit 2026-07-23 20:38:18 +02:00
OpenSquared
6eba6ce5f8 feat: cockpit 2026-07-23 19:29:32 +02:00
OpenSquared
d3dc85fee9 feat: saxo price 2026-07-23 17:59:27 +02:00
OpenSquared
a136d6ae11 feat: saxo price 2026-07-23 10:33:18 +02:00
OpenSquared
78eda311f8 feat: option lab 2026-07-21 17:23:55 +02:00
OpenSquared
b6e9b96dc4 feat: cockpit 2026-07-21 16:48:12 +02:00
OpenSquared
6c22b3f552 feat: strategy builder 2026-07-21 10:18:15 +02:00
OpenSquared
67952e01fa feat: strategy builder 2026-07-19 10:55:56 +02:00
OpenSquared
3417bb6075 feat: strategy builder 2026-07-19 09:39:09 +02:00
OpenSquared
e7247d4c4c feat: saxo history 2026-07-19 08:49:57 +02:00
OpenSquared
d4fb15ca9a feat: saxo 2026-07-19 00:55:46 +02:00
OpenSquared
0d3a6a6fad feat: saxo 2026-07-18 22:20:33 +02:00
OpenSquared
b0b7f9bfda feat: option 2026-07-18 22:04:43 +02:00
OpenSquared
d359480302 feat: saxo connector 2026-07-18 20:27:44 +02:00
OpenSquared
dec5da37b1 feat: saxo connector 2026-07-18 19:44:32 +02:00
OpenSquared
212bdf6678 feat: sexo history 2026-07-18 18:54:12 +02:00
OpenSquared
ff242bd2a6 feat: saxo history 2026-07-18 18:26:07 +02:00
OpenSquared
bff2f70781 Saxo connector 2026-07-18 17:14:13 +02:00
OpenSquared
91054979ec feat: strategy builder 2026-07-18 16:37:35 +02:00
OpenSquared
2d474c9194 feat: cycle 2026-07-15 12:03:02 +02:00
OpenSquared
ce9c0b53a9 feat: chatbot 2026-07-15 08:47:16 +02:00
OpenSquared
c4de6957ea feat: chatbot 2026-07-14 17:31:34 +02:00
OpenSquared
b693aca2dc feat: wavelets 2026-07-14 16:23:18 +02:00
OpenSquared
09b9efeda7 feat: new cockpit 2026-07-14 12:17:15 +02:00
OpenSquared
ad07c8d886 feat: new cockpit 2026-07-14 11:21:43 +02:00
OpenSquared
3b7fa35456 feat: Specialist Desks v2 — COT, Forward Curves, Surprise Index, Hawk/Dove scorer
- COT Positioning: CFTC disaggregated + financial futures (19 markets) via Socrata free API
  net MM position % OI + weekly change stored in cot_data table
- Forward Curves: yfinance front-month vs +3M slope (8 commodities)
  contango/backwardation/flat stored in forward_curve_data table
- Surprise Index: consensus_estimate + actual_value on specialist_reports
  auto-computes surprise_score = actual - consensus on save
- Hawk/Dove Text Scorer: GPT-4o-mini endpoint for CB statements
  score -1..+1, label, summary, key_phrases (forex/bonds: hawk/dove; commodities: bull/bear)
- AI context injection: COT net positioning, forward curve structure,
  surprise scores, upcoming consensus estimates injected into all desk blocks
- Frontend: COT panel (net% bars), Forward Curves panel, SurpriseInput
  on report cards, Hawk/Dove scorer in forex/bonds config tab
- auto_cycle.py: non-blocking COT + curve refresh before each cycle

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 18:00:46 +02:00
OpenSquared
91f12e177f feat: pattern calibration — progressive AI→observed expected_move blending
DB (database.py):
- 3 new columns on custom_patterns: calibrated_expected_move, calibration_weight, observed_avg_win_pct
- update_bayesian_posteriors() now also computes credibility blend w=n/(n+5):
  calibrated = (1-w)*ai_estimate + w*observed_avg_win_pct (only when wins exist)
- log_trade_entries() prefers calibrated_expected_move when w>10%
- get_calibration_summary() returns per-pattern state (source: pure_ai/early/mixed/data_driven)

Backend (patterns.py, auto_cycle.py):
- GET /api/patterns/calibration endpoint
- calibration_report block in cycle report: counts by source, avg weight, per-pattern detail

Frontend (PatternExplorer.tsx, RapportIA.tsx, useApi.ts):
- MaturityBadge on each PatternCard: blend bar (AI→observed), win rate, AI estimate vs calibrated
- usePatternCalibration hook
- Cycle report: calibration section with global bar + per-pattern table (weight%, n_trades, WR, AI→calibrated)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 12:38:16 +02:00
OpenSquared
a630cdc708 feat: Find Similar + Merge in Pattern Library
Backend (patterns.py):
- POST /api/patterns/find-similar — GPT-4o-mini compares a library pattern
  against all others; returns merge_as_instance | counter_scenario | new_pattern
- POST /api/patterns/merge — full transactional merge: remaps pattern_id in
  pattern_score_history, trade_entry_prices, ai_reasoning_traces, ai_call_logs,
  skipped_trades; unions historical_instances (dedup); sums backtest counters;
  deletes the discarded pattern

Frontend (PatternExplorer.tsx + useApi.ts):
- ScanSearch button on each non-builtin card triggers find-similar
- Inline result panel: duplicate → merge CTA with confirmation + destructive warning
  counter_scenario → apply regime_tag CTA; new_pattern → green "unique" badge
- useFindSimilarPattern + useMergePatterns hooks invalidate all-patterns on success

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 12:13:33 +02:00
OpenSquared
2fb683eec5 feat: Specialist Desks — per asset-class fundamental configs + report catalogue
- 7 pre-seeded desks (Forex, Metals, Agri, Energy, Indices, Crypto, Bonds)
  each with default fundamental drivers, macro regime sensitivities and
  price delta thresholds
- Global report catalogue (specialist_reports) fully manual — add any report
  including non-calendar ones (e.g. Cocoa Grinding Report, ICCO)
- Many-to-many report ↔ desk linking (report_desk_links table)
- 12 default reports pre-seeded (COT, EIA, WASDE, FOMC, ECB, CPI, NFP…)
- AI scorer injects SPECIALIST DESK context block for asset classes present
  in each scoring batch (upcoming reports, key drivers, regime sensitivity)
- /specialist-desks page: desk sidebar + fundamentals editor + macro
  sensitivity tag editor + reports tab + global reports catalogue + modal
  to create/edit any report with desk assignment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 09:57:18 +02:00
OpenSquared
c3ea0b7f8c feat: dynamic market ticker watchlist (Markets page)
Add ability to add/remove custom tickers (e.g. EURCHF=X) on the
Markets & Prices page without editing config. Tickers are validated
via yfinance, persisted in market_watchlist SQLite table, merged into
the quotes feed as a 'custom' group, and shown in a dedicated tab
with per-card remove buttons.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 21:54:58 +02:00
OpenSquared
78c60d5254 feat: Pattern Lab Discover + fix history run display
Fix: history runs now always show results — create synthetic selected preset
from run data when no matching preset found (was broken for custom events).
Also force mode='events' and reset matchResults on history load.

Discover tab: new "Discover" panel in left sidebar (AI knowledge search).
- GPT-4o generates 6 matching events from a free-text query (date, assets, hint)
- Confidence score + category badge per event
- Click → pre-fills experiment form exactly like a preset → ready to Run
- Backend: POST /api/pattern-lab/discover (DiscoverRequest, sorted by confidence)
- Frontend: useDiscoverEvents hook + DiscoveredEvent type + Discover UI with
  Enter-to-search, spinner, empty states

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 21:36:00 +02:00
OpenSquared
a2315c3b78 feat: inline edit for patterns in library (name, description, category, direction, regime)
- Backend: PATCH /api/patterns/custom/{id} — partial update, only provided fields changed
- useApi.ts: usePatchPattern mutation hook
- PatternCard: pencil icon (non-builtin only) → edit mode with inline inputs for name, description, direction (select), category, and #regime; ✓/✗ buttons to save or cancel; card border highlights blue while editing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 21:13:34 +02:00
OpenSquared
a435c11246 feat: regime system — Find Matching + By Regime view
- Pattern Lab: "Find Matching" button per pattern uses GPT-4o-mini to classify against library (merge_as_instance / counter_scenario / new_pattern); shows match badge + confidence + suggested #regime_tag; conditional action buttons (Merge / Save counter / Save new)
- save_pattern_from_run handles action='instance' (appends to historical_instances + updates stats), action='counter' (new pattern with counter_of link, tags parent regime_tag), action='new' (unchanged + regime_tag support)
- useApi.ts: extended useSaveLabPattern type + new useFindMatchingPattern mutation + MatchResult export type
- DB migrations: regime_tag + counter_of columns on custom_patterns
- PatternExplorer: new "By Regime" view groups saved patterns by regime_tag; RegimeCard shows historical instances, hit rate, counter-of link (orange); untagged group at bottom

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 20:52:11 +02:00
OpenSquared
6cca7f66b6 feat: ticker validation + SLV/USO/WEAT/CORN/TUR added to ETFs watchlist
Backend:
- GET /api/market/validate?symbol= — validates ticker against yfinance,
  returns {valid, name, price} or {valid: false, reason: 'helpful message'}
- Added SLV, USO, WEAT, CORN, TUR to ETFs WATCHLIST category

Frontend:
- validateTicker() async helper exported from useApi.ts
- InstrumentPicker (PatternLab): custom ticker field now validates before selecting
  Shows spinner while checking, red error message if not found on yfinance
- InstrumentLens (PatternExplorer): same validation on Go button + Enter key

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 20:15:26 +02:00
OpenSquared
303ecc2a3a feat: instrument picker + Pattern Lab instrument scan mode
- instruments.ts: 90 IB-options-tradable instruments in 12 categories
  (US Indices, Europe, Asia, EM, Sectors, Forex, Bonds, Metals, Energy,
   Agriculture, Crypto, Volatility) — EUR/CHF, Cotton, etc. all included

- PatternExplorer: replace text input in Instrument Lens with categorised
  grid picker (category pill filters + search + custom ticker fallback)

- PatternLab: add Instrument Scan tab alongside Event Presets
  - Pick any instrument from the shared categorised picker
  - Set period (start/end date) + horizon per pattern
  - AI scans the full period: identifies 4-6 key pattern instances each with
    their own entry date, expected move, strategy
  - 'Evaluate outcomes' fetches actual price at T+horizon per pattern
  - 'Save pattern' promotes any instance to the Pattern Library

- backend/services/pattern_lab.py: run_instrument_scan() + evaluate_instrument_outcomes()
  (per-pattern analysis_date vs shared date in event mode)
- backend/routers/pattern_lab.py: POST /instrument-scan + POST /evaluate-instrument/{id}
- useApi.ts: useInstrumentScan + useEvaluateInstrumentScan hooks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 18:20:22 +02:00