Stock Trading Automation
Paper-trading first. Measure everything. Automate only what we can observe and improve.
π Pythonπ pandas / vectorbtβ‘ FastAPIποΈ SQLite / PostgreSQLπ Paper Trading
π§ Planned Project
β‘ Why This Project?
Trading is noisy and emotional. The plan is to build a repeatable, testable automation pipeline that operates on practice funds only, while we learn, monitor, and refine. Once the data proves edge and operational reliability, we can consider graduated steps toward limited real-cap exposure.
π― Objectives
- Ingest market data (price, volume, fundamentals/news where feasible).
- Implement rule-based strategies with clear, auditable entry/exit logic.
- Run on practice funds only (paper trading) with broker API or simulator.
- Track PnL, drawdown, hit-rate, expectancy, slippage, and latency.
- Establish robust logging, alerts, and auto-suspension on risk limits.
π§ͺ MVP Scope (Paper-Only)
- Data ingest (minute or 5-min candles) into local DB for backtest & live sim.
- Two baseline strategies (e.g., momentum breakout, mean reversion).
- Order simulator with fees, partial fills, and position sizing rules.
- Daily report (PnL, open risk, KPI deltas) + on-failure alerts.
- One-click kill switch and auto-circuit breaker on breach.
π οΈ Tools & Stack (Planned)
- Python (pandas, vectorbt/backtesting.py) for strategies & backtests
- FastAPI for a small control plane and webhooks
- SQLite/PostgreSQL for market & trade logs
- Broker API or paper-trade SDK (TBD) for practice execution
- Next.js dashboard for live KPIs and change logs
π‘ Data Sources (Exploratory)
Start with free/low-cost OHLCV feeds suitable for backtesting and simulated intraday runs. Expand to fundamentals and news sentiment later if initial signals warrant complexity. All sources must be licensed appropriately for storage and replay in backtests.
π§― Risk & Controls
- Paper-only until stability and positive expectancy are demonstrated.
- Per-strategy max loss, daily loss limit, and drawdown halts.
- Full audit logs: signals β orders β fills β PnL.
- Deterministic backtests; pinned versions of data & code.
π KPIs to Watch
- Net expectancy (per trade & per day) and win/loss distribution.
- Max drawdown vs. target; Sharpe/Sortino (paper).
- Slippage vs. assumed; latency and missed fills in sim.
- Strategy stability across regimes (walk-forward windows).
πΊοΈ Roadmap (High Level)
- Data pipeline + local DB; backtest harness.
- Baseline strategies + metrics; daily paper runs.
- Dashboard, alerts, and circuit breakers.
- Walk-forward validation + parameter sanity rules.
- Consider tiny live-cap pilot only after β₯8 weeks of green KPIs.