A Python market-monitoring and Telegram alerting system for a VWAP pullback strategy. Live monitoring and the maintained historical backtests share one strategy implementation. Trade Lab does not place orders, observe broker fills, or reconcile account positions.
- New York timezone-aware session handling and completed-bar filtering.
- Shared VWAP, true-range, ATR, and first-signal logic for live monitoring and historical backtests.
- Explicit OHLC stop/target simulation with conservative collision handling and separate open-position marks.
- Risk-based sizing using shared configuration.
- Telegram alerting with validated, checkpointed state persistence.
- Pytest, Ruff, and documentation verification in GitHub Actions.
- Backtest signal parity does not establish fill parity with a broker.
- Spread, commission, financing, market impact, and ordinary slippage are not modeled.
- QQQ/NQ conversion and CFD lot assumptions are not broker-validated.
- Historical data coverage and quality depend on Yahoo Finance; input snapshots are not committed.
- A backtest is not evidence of profitability. Do not rely on results from the old duplicated calculations as if they were generated by the current shared strategy.
Requires Python 3.10 or newer.
git clone https://github.com/Emiloart/trade_lab.git
cd trade_lab
python -m venv .venvActivate the environment:
# macOS / Linux
source .venv/bin/activate
# Windows PowerShell
.venv\Scripts\Activate.ps1Install:
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"Live and backtest commands use the same StrategyConfig.from_env() settings. See Configuration for supported environment variables and defaults. Never commit Telegram credentials or runtime state.
python -m trade_lab.live --dry-runDownload the 5-minute input and run either the full-history or recent-period simulation:
python strategies/data_downloader.py
python backtests/vwap_backtest.py
python backtests/recent_backtest.pyBoth scripts call the shared strategy implementation. See Backtesting for fill assumptions, output fields, and interpretation limits.
python -m pytest -q
ruff check trade_lab backtests/_common.py backtests/vwap_backtest.py backtests/recent_backtest.py tests
python scripts/verify_docs.pySee docs/README.md for architecture, strategy, configuration, operations, risk, backtesting, decisions, testing, and troubleshooting references.
Created by: prosperlpx — original concept, VWAP pullback setup, repo founder. Maintained by: Emiloart — core engine, research pipeline, operations