- discover_active_symbols requested get_most_actives(top*3); once screen_universe
used top*2 headroom for the ETF filter (top=20 -> 40 -> get_most_actives(120)),
this exceeded Alpaca's hard cap of 100 -> HTTP 400, swallowed by the bare
except -> discovery returned EMPTY every cycle. The live loop therefore traded
the static fallback list (non-gappers) instead of real movers all morning.
Fix: cap at min(top*3, 100). Verified: screen_universe now returns 20 real
sub-$20 names, ETF-filtered.
- Add ./momentum launcher (project venv) so 'momentum watch' works without the
full venv path ('python' on the box is the Windows pyenv shim, no deps).
67/67 tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
15 lines
657 B
Bash
15 lines
657 B
Bash
#!/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 "$@"
|