feat(kevin-exec): attribute trades to strategy_id (record + dashboard)

The executor wrote trades with strategy_id=None, so Kevin trades were unattributed and invisible to the dashboard, which filters by strategy_id. Set strategy_id=signal.strategy_id on both the persisted Trade row and the published TradeExecution.

[ci skip]

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Viktor Barzin 2026-06-04 22:01:44 +00:00
parent 14407d37dc
commit a8b0d33bd1
2 changed files with 38 additions and 1 deletions

View file

@ -183,7 +183,7 @@ async def process_signal(
price=result.filled_price or 0.0,
status=result.status,
signal_id=signal.signal_id,
strategy_id=None,
strategy_id=signal.strategy_id,
strategy_sources=signal.strategy_sources,
timestamp=result.timestamp,
)
@ -210,6 +210,7 @@ async def process_signal(
price=result.filled_price or 0.0,
timestamp=str(result.timestamp),
signal_id=signal.signal_id,
strategy_id=signal.strategy_id,
status=status_map.get(result.status, TradeStatusModel.PENDING),
)
session.add(db_trade)