feat: dynamic market ticker watchlist (Markets page)
Add ability to add/remove custom tickers (e.g. EURCHF=X) on the Markets & Prices page without editing config. Tickers are validated via yfinance, persisted in market_watchlist SQLite table, merged into the quotes feed as a 'custom' group, and shown in a dedicated tab with per-card remove buttons. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -136,6 +136,24 @@ def get_all_quotes() -> Dict[str, List[Dict[str, Any]]]:
|
||||
q["asset_class"] = asset_class
|
||||
quotes.append(q)
|
||||
result[asset_class] = quotes
|
||||
|
||||
# User-added custom tickers
|
||||
try:
|
||||
from services.database import get_market_custom_tickers
|
||||
custom_entries = get_market_custom_tickers()
|
||||
if custom_entries:
|
||||
custom_quotes = []
|
||||
for entry in custom_entries:
|
||||
q = get_quote(entry["ticker"])
|
||||
if q:
|
||||
q["name"] = entry["name"] or entry["ticker"]
|
||||
q["asset_class"] = "custom"
|
||||
custom_quotes.append(q)
|
||||
if custom_quotes:
|
||||
result["custom"] = custom_quotes
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user