A Python framework for testing whether discrete market events (e.g. congressional trades) change the distribution of future returns.
Answer a single question:
Does a specific event provide a measurable edge in future price movement?
This project does not build a trading system. It builds a hypothesis testing engine.
- Congressional trade ingestion: working
- Event parsing and enrichment: working
- Backtesting engine: working
- Hypothesis framework: partially implemented
This project is evolving from a simple insider-event backtest into a dataset-discovery and event-study pipeline. Current focus areas:
- locating reliable disclosure datasets
- improving scraper coverage
- normalising event data
- comparing insider signals against market benchmarks
filing_datemostly missing → event timing not reliable- Current tests use transaction date (not ideal)
- Sample size small
- No statistical significance testing yet
- Congressional trades (Senate disclosures)
- Price data via
yfinance
raw data → parser → event table → backtest → report
ticker
event_date
filing_date
transaction_type
shares_before
shares_after
event_type
direction (always None at this stage)
source
purchase
partial_sale
full_exit_sale
Derived:
cluster_flag
cluster_size
- Parser produces facts only
- Hypothesis layer assigns interpretation
- No narrative logic in code
- All signals must be testable
- Weekly iteration discipline
hypothesis: purchase_bullish
event_type: purchase
expected_direction: bullish
horizons: [5, 20, 60]
min_sample_size: 10Each test produces:
mean return
median return
hit rate
sample size
baseline comparison
decision
Saved to:
reports/
Install dependencies:
pip install -r requirements.txtRun pipeline (temporary entry point):
python main.py(Note: entry script will be replaced with scripts/run_hypothesis.py)
- Event timing not yet correct (disclosure vs transaction)
- Congressional data is delayed and incomplete
- Small dataset → results exploratory only
- No cross-validation yet
See:
ROADMAP.md
- No trading bot
- No portfolio optimisation
- No news sentiment analysis
- No paid data (until edge is proven)
MIT