Merge pull request 'fix: log blackout recovery executions to DB (#324)' (#339) from feature/issue-324-blackout-recovery-trade-log into feature/v3-session-policy-stream
Some checks failed
Gitea CI / test (push) Has been cancelled
Some checks failed
Gitea CI / test (push) Has been cancelled
Reviewed-on: #339
This commit was merged in pull request #339.
This commit is contained in:
14
src/main.py
14
src/main.py
@@ -759,6 +759,20 @@ async def process_blackout_recovery_orders(
|
||||
|
||||
accepted = result.get("rt_cd", "0") == "0"
|
||||
if accepted:
|
||||
runtime_session_id = get_session_info(market).session_id
|
||||
log_trade(
|
||||
conn=db_conn,
|
||||
stock_code=intent.stock_code,
|
||||
action=intent.order_type,
|
||||
confidence=0,
|
||||
rationale=f"[blackout-recovery] {intent.source}",
|
||||
quantity=intent.quantity,
|
||||
price=float(intent.price),
|
||||
pnl=0.0,
|
||||
market=market.code,
|
||||
exchange_code=market.exchange_code,
|
||||
session_id=runtime_session_id,
|
||||
)
|
||||
logger.info(
|
||||
"Recovered queued order executed: %s %s (%s) qty=%d price=%.4f source=%s",
|
||||
intent.order_type,
|
||||
|
||||
Reference in New Issue
Block a user