diff --git a/application/execution_service.py b/application/execution_service.py index 623b420..6915384 100644 --- a/application/execution_service.py +++ b/application/execution_service.py @@ -412,7 +412,7 @@ def _iter_open_orders(ib) -> list[Any]: def _extract_open_order_symbol(order_like: Any) -> str | None: contract = getattr(order_like, "contract", None) if contract is None and hasattr(order_like, "order"): - contract = getattr(order_like, "contract", None) + contract = getattr(order_like.order, "contract", None) symbol = getattr(contract, "symbol", None) if symbol is None and hasattr(order_like, "symbol"): symbol = getattr(order_like, "symbol") diff --git a/application/rebalance_service.py b/application/rebalance_service.py index 8cd9f8e..7138999 100644 --- a/application/rebalance_service.py +++ b/application/rebalance_service.py @@ -65,22 +65,6 @@ def _localize_notification_text(text: str, *, translator) -> str: ) -def _render_notification_context_text( - notification_context: Mapping[str, object] | None, - *, - translator, - fallback: str = "", -) -> str: - if not isinstance(notification_context, Mapping): - return fallback - key = str(notification_context.get("code") or "").strip() - if not key: - return fallback - params = dict(notification_context.get("params") or {}) - rendered = translator(key, **params) - return fallback if rendered == key else str(rendered) - - def _should_suppress_noop_notification(signal_metadata: Mapping[str, object] | None) -> bool: metadata = signal_metadata if isinstance(signal_metadata, Mapping) else {} no_op_reason = str(metadata.get("no_op_reason") or "").strip() @@ -121,15 +105,6 @@ def _resolve_reconciliation_mode( return _normalize_reconciliation_mode(getattr(config, "execution_mode", None), fallback="paper") -def _translate_snapshot_guard_decision(decision: object, *, translator) -> str: - value = str(decision or "").strip() - if not value: - return "" - key = f"snapshot_guard_decision_{value}" - translated = translator(key) - return value if translated == key else str(translated) - - def _localize_timing_contract(contract: str, *, translator) -> str: value = str(contract or "").strip() if not value: