A two-part trading scaffold for a Finviz Elite screener strategy with a brains service (signal + state + orchestration) and an execution service (paper broker now, real broker later).
- Minute-level polling of a configurable Finviz Elite screener.
- Strategy: buy $1,000 per symbol (configurable), create 4 staged limit-sell targets (+10%, +20%, +50%, +100%).
- Clean separation between brain (what to trade) and execution (how to trade).
- Pluggable Finviz client, market data provider, and broker interface.
- Paper broker simulation with deterministic synthetic quotes for local development.
- Python 3.11+ and
pipavailable. - Create a virtual environment:
python -m venv .venv
. .venv/Scripts/activate
pip install -r requirements.txt
- Copy
.env.exampleto.envand adjust values if needed (e.g., Finviz cookies, state file path). - Run the brains service (includes scheduler):
python -m src.brain.brain_service
- Run tests:
pytest
src/brain: strategy, state, Finviz client, scheduling, orchestration.src/execution: broker abstraction and paper implementation.src/shared: logging setup, time utilities.tests: basic coverage for strategy, broker, and Finviz parsing.
- Finviz Elite may require authentication; provide cookies via environment variables if needed.
- Paper fills:
- Market buys fill on the next
simulate_minutecall atlast * 1.001to approximate the bar high. - Limit sells fill when the minute mid-price meets/exceeds the limit.
- Market buys fill on the next
- State persistence uses a JSON file for v1 and can be swapped for a database later.
- Wire a real market data feed and broker implementation.
- Harden Finviz scraping (or replace with an API).
- Add richer risk management, stops, and intraday resets.