Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion notifications/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,22 @@ def _localize_notification_text(text: str, *, translator) -> str:
)


def _infer_quote_overlay_used(source: str, overlay):
if overlay is not None:
return overlay
normalized_source = str(source or "").strip().lower()
if "with_live_quote_overlay" in normalized_source:
return True
if normalized_source in {
"longbridge_candlesticks",
"historical_close",
"snapshot_close",
"market_quote",
}:
return False
Comment on lines +114 to +120

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark mixed fallback sources as no overlay

When any symbols use fallback pricing, application/execution_service.py records price_source_mode as mixed_market_quote_<fallback> and main.py copies that into signal_snapshot.latest_price_source; those values are already localized as mixed_market_quote_snapshot_close / mixed_market_quote_historical_close. Because this allowlist only matches the exact fallback source names, those normal fallback runs still render quote overlay unknown even though they are market-quote/fallback modes with no live quote overlay. Please include the mixed market-quote fallback modes in the false inference.

Useful? React with 👍 / 👎.

return None


def _localize_timing_contract(contract: str, *, translator) -> str:
value = str(contract or "").strip()
if not value:
Expand Down Expand Up @@ -353,7 +369,7 @@ def _format_signal_snapshot_line(snapshot, *, translator) -> str:
return ""
market_date = str(snapshot.get("market_date") or snapshot.get("signal_as_of") or "").strip()
source = str(snapshot.get("latest_price_source") or "").strip()
overlay = snapshot.get("quote_overlay_used")
overlay = _infer_quote_overlay_used(source, snapshot.get("quote_overlay_used"))
warning = snapshot.get("data_freshness_warning")
if not market_date and not source and overlay is None and warning in (None, "", False):
return ""
Expand Down