diff --git a/momentum b/momentum new file mode 100644 index 0000000..2923f92 --- /dev/null +++ b/momentum @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# momentum — run the inspection/monitoring CLI with the project's venv. +# Usage: ./momentum watch | doctor | inspect signals | inspect criteria SYM | ... +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +VENV_PY="/home/philip/.venvs/momentum/bin/python" +if [ ! -x "$VENV_PY" ]; then + echo "venv python not found at $VENV_PY" >&2 + echo "create it:" >&2 + echo " uv venv \"\$HOME/.venvs/momentum\" --python 3.13" >&2 + echo " uv pip install --python \"\$HOME/.venvs/momentum\" psycopg2-binary pandas pydantic pydantic-settings pyyaml typer rich numpy python-dotenv" >&2 + exit 1 +fi +cd "$ROOT" +exec "$VENV_PY" momentum_cli.py "$@" diff --git a/research/ingestion/market_data.py b/research/ingestion/market_data.py index 9884dd2..72ca1fb 100644 --- a/research/ingestion/market_data.py +++ b/research/ingestion/market_data.py @@ -234,7 +234,8 @@ def discover_active_symbols( static symbol list. """ try: - actives = client.get_most_actives(top=top * 3, by="volume") + # Alpaca caps the most-actives `top` at 100; never request more. + actives = client.get_most_actives(top=min(top * 3, 100), by="volume") symbols = [a["symbol"] for a in actives if a.get("symbol")] if not symbols: return []