INNER CODE UNIT · Python

watchlist_names

renee-jia/trading-bot · ai_portfolio.py:53

def watchlist_names(core=None):
    """Second-tier candidates, minus anything already in the core list."""
    raw = os.environ.get("AI_PORTFOLIO_WATCH", "").strip()
    names = [x.strip().upper() for x in raw.split(",") if x.strip()] if raw else list(DEFAULT_WATCHLIST)
    core = set(core if core is not None else portfolio_list())
    out = []
    for n in names:
        if n not in out and n not in core:
            out.append(n)
    return out


def _num(v):
    if v is None:
        return None
    try:
        f = float(v)
    except (TypeError, ValueError):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…