etrade-pelosi-botMirror congressional stock trades with automated broker execution and risk management
Install via ClawdBot CLI:
clawdbot install mainfraame/etrade-pelosi-botMirror congressional stock trades with automated broker execution
ClawBack tracks stock trades disclosed by members of Congress (House and Senate) and executes scaled positions in your brokerage account. Built on the premise that congressional leaders consistently outperform the market due to informational advantages.
| Strategy | Win Rate | Return | Sharpe |
|----------|----------|--------|--------|
| 3-day delay, 30-day hold | 42.9% | +6.2% | 0.39 |
| 9-day delay, 90-day hold | 57.1% | +4.7% | 0.22 |
Congressional leaders have outperformed the S&P 500 by 47% annually according to NBER research.
# Clone and setup
git clone https://github.com/openclaw/clawback
cd clawback
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# Configure secrets
python3 src/config_loader.py setup
# Authenticate with broker
python3 src/main.py interactive
# Select option 1 to authenticate
# Set up automation
./scripts/setup_cron.sh
ClawBack reads secrets from environment variables or config/secrets.json:
{
"BROKER_API_KEY": "your-broker-api-key",
"BROKER_API_SECRET": "your-broker-api-secret",
"BROKER_ACCOUNT_ID": "your-account-id",
"TELEGRAM_BOT_TOKEN": "optional-for-notifications",
"TELEGRAM_CHAT_ID": "optional-for-notifications"
}
ClawBack uses an adapter pattern for broker integration. Each broker implements a common interface defined in broker_adapter.py.
| Broker | Adapter | Status |
|--------|---------|--------|
| E*TRADE | etrade_adapter.py | Supported |
| Schwab | schwab_adapter.py | Planned |
| Fidelity | fidelity_adapter.py | Planned |
To specify which broker to use, set broker.adapter in your config:
{
"broker": {
"adapter": "etrade",
"credentials": {
"apiKey": "${BROKER_API_KEY}",
"apiSecret": "${BROKER_API_SECRET}"
}
}
}
All data is scraped directly from official government sources:
| Source | Data | Method |
|--------|------|--------|
| House Clerk | House PTR filings | PDF parsing |
| Senate eFD | Senate PTR filings | Selenium scraping |
No third-party APIs required for congressional data.
Edit config/config.json to customize:
{
"strategy": {
"entryDelayDays": 3,
"holdingPeriodDays": 30,
"purchasesOnly": true,
"minimumTradeSize": 50000
},
"riskManagement": {
"positionStopLoss": 0.08,
"trailingStopActivation": 0.10,
"trailingStopPercent": 0.05,
"maxDrawdown": 0.15
}
}
# Interactive mode
python3 src/main.py interactive
# Single check cycle
python3 src/main.py run
# Scheduled trading
python3 src/main.py schedule 24
# Run backtest
python3 src/backtester.py
# Install cron jobs
./scripts/setup_cron.sh
# Manual runs
./scripts/run_bot.sh check # Check for new trades
./scripts/run_bot.sh monitor # Check stop-losses
./scripts/run_bot.sh full # Both
clawback/
βββ src/
β βββ main.py # Main entry point
β βββ congress_tracker.py # Congressional data collection
β βββ trade_engine.py # Trade execution & risk management
β βββ broker_adapter.py # Abstract broker interface
β βββ etrade_adapter.py # E*TRADE broker implementation
β βββ database.py # SQLite state management
β βββ config_loader.py # Configuration handling
βββ config/
β βββ config.json # Main configuration
β βββ secrets.json # API keys (git-ignored)
βββ scripts/
β βββ run_bot.sh # Cron runner
β βββ setup_cron.sh # Cron installer
βββ data/
βββ trading.db # SQLite database
This software is for educational purposes only. Trading stocks involves substantial risk of loss. Past performance of congressional trades does not guarantee future results. The authors are not financial advisors. Use at your own risk.
MIT License - See LICENSE file
Built with ClawBack for the OpenClaw community
Generated Mar 1, 2026
A retail investor uses ClawBack to automatically replicate congressional stock trades in their personal brokerage account, leveraging the tool's real-time tracking and automated execution to mimic trades with scaled positions and risk management. This allows them to potentially benefit from the informational advantages of congressional leaders without manual monitoring.
A financial advisory firm integrates ClawBack into their service offerings to provide clients with automated mirroring of congressional trades as a value-added strategy. They use the backtesting engine to validate performance and customize risk settings to align with client portfolios, enhancing their investment management tools.
An educational platform or fintech startup uses ClawBack as a teaching tool to analyze congressional trading patterns and market impacts. Students or users run backtests and adjust strategy settings to learn about automated trading, risk management, and data scraping in a practical, real-world context.
A university or research institution employs ClawBack to collect and analyze congressional trade data for academic studies on market efficiency and political influence. They utilize the automated data scraping and backtesting features to generate insights without relying on third-party APIs.
A hedge fund incorporates ClawBack as part of a quantitative strategy to generate alpha by mirroring congressional trades with high-frequency adjustments. They leverage the risk management features like trailing stop-losses and drawdown limits to manage large-scale positions across multiple accounts.
Offer ClawBack as a cloud-hosted service where users pay a monthly or annual subscription fee for access to automated trade mirroring, real-time alerts via Telegram, and premium features like advanced backtesting. Revenue is generated through tiered pricing based on account size or trade volume.
License the ClawBack software to financial institutions, brokerages, or fintech companies who rebrand and integrate it into their own platforms. Revenue comes from upfront licensing fees and ongoing support contracts, allowing partners to offer congressional trade mirroring as a proprietary feature.
Provide a free version of ClawBack with basic features to attract users, then monetize through partnerships with brokers like E*TRADE, where revenue is earned via referral commissions or API usage fees. Premium upgrades could include additional brokers, enhanced risk tools, or priority support.
π¬ Integration Tip
Ensure secure handling of API keys and secrets via environment variables, and test the broker adapter with a demo account before live trading to avoid execution errors.
A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands.
Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications.
Advanced desktop automation with mouse, keyboard, and screen control
Manage n8n workflows and automations via API. Use when working with n8n workflows, executions, or automation tasks - listing workflows, activating/deactivating, checking execution status, manually triggering workflows, or debugging automation issues.
Design and implement automation workflows to save time and scale operations as a solopreneur. Use when identifying repetitive tasks to automate, building workflows across tools, setting up triggers and actions, or optimizing existing automations. Covers automation opportunity identification, workflow design, tool selection (Zapier, Make, n8n), testing, and maintenance. Trigger on "automate", "automation", "workflow automation", "save time", "reduce manual work", "automate my business", "no-code automation".
Browser automation via Playwright MCP server. Navigate websites, click elements, fill forms, extract data, take screenshots, and perform full browser automation workflows.