CLI tool for managing trading orders on Alpaca with automated execution logging, analytics, and dbt transformations.
- Real-time stock/options order entry with risk-reward calculations
- Paper and live trading modes via Alpaca API
- Live market data streaming and portfolio monitoring
- Automated execution and stop order logging to DuckDB/MotherDuck
- Trade tracking with unique trade IDs for entry/exit correlation
- dbt transformations for trade metrics and performance analysis
- Watchlist and account snapshot tracking
- Python 3.11+
- uv package manager
- Alpaca API credentials (paper or live)
- DuckDB/MotherDuck database
uv syncSet environment variables for Alpaca API and database connection (see .env file requirements).
Run trading scripts from project root:
uv run src/trading_analytics/processes/log_watchlists.pyRun dbt transformations:
cd src/trading_analytics/trading_analytics_dbt
uv run dbt runentry_executions: Aggregated entry-level execution dataexit_executions: Aggregated exit-level execution datatrade_executions: Combined entry/exit data per tradeclosed_trades: Fully closed positions onlytrades_view: Enhanced trade metrics with risk/reward calculationsavg_performance_month: Monthly aggregated performance metrics
This project is licensed under the MIT License.