feat: cockpit command center + skipped trades journal
Dashboard: insert 2 rows of 4 mini-cards between top row and trade ideas - Row 1: PnL Simulé, Risque Simulé, Dernier Cycle, Régime Macro - Row 2: Super Contexte, Signaux Géo, Meilleur Pattern, Patterns Actifs - All cards link to underlying pages via react-router Link Journal: add 'Non loggés' tab exposing trades suggested by cycle but skipped because no risk profile was matched - New skipped_trades table (auto-created on backend restart) - log_trade_entries() persists each skip with score/gain/asset_class - GET /api/journal/skipped-trades + useSkippedTrades hook Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@ from services.database import (
|
||||
get_macro_regime_history, get_geo_alert_history, get_trade_entry_prices,
|
||||
get_closed_trades, close_trade, update_trade_exit_params,
|
||||
get_trade_entry_by_id, get_config, set_config, reset_journal_history,
|
||||
_fetch_live_prices, _trade_maturity,
|
||||
_fetch_live_prices, _trade_maturity, get_skipped_trades,
|
||||
)
|
||||
import json
|
||||
|
||||
@@ -253,6 +253,13 @@ def trade_check(body: TradeCheckRequest):
|
||||
return check_new_trade(body.underlying, body.strategy, body.asset_class)
|
||||
|
||||
|
||||
@router.get("/skipped-trades")
|
||||
def skipped_trades_endpoint(days: int = 30):
|
||||
"""Trades suggested by cycle that didn't pass any risk profile threshold."""
|
||||
trades = get_skipped_trades(days)
|
||||
return _sanitize({"trades": trades, "days": days, "count": len(trades)})
|
||||
|
||||
|
||||
@router.delete("/reset")
|
||||
def reset_journal():
|
||||
"""Truncate all journal history (trades, macro, geo, cycles). Irreversible."""
|
||||
|
||||
Reference in New Issue
Block a user