executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
clawbackMirror congressional stock trades with automated broker execution and risk management. Use when you want to track and automatically trade based on congressional disclosures from House Clerk and Senate eFD sources.
Independent GitHub snapshot · Automated classification · Original documentation governs
Mirror congressional stock trades with automated broker execution
When the user invokes /clawback, execute the appropriate command based on the argument:
| Command | Action |
|---|---|
/clawback setup | Interactive setup - prompt for credentials (see below) |
/clawback status | Check status: cd {baseDir} && source venv/bin/activate && python -m clawback.cli status |
/clawback run | Start trading: cd {baseDir} && source venv/bin/activate && python -m clawback.cli run |
/clawback | Default to status check |
/clawback setup - Interactive Setup FlowWhen user runs /clawback setup, follow these steps:
Step 1: Install dependencies (if needed)
Check if {baseDir}/venv exists. If not, run:
cd {baseDir} && python3 -m venv venv && source venv/bin/activate && pip install -e .
Step 2: Prompt for E*TRADE credentials Ask the user for each value:
Environment: Ask "Do you want to use sandbox (testing) or production (real money)?"
Consumer Key: Ask "Enter your E*TRADE Consumer Key (from developer.etrade.com):"
Consumer Secret: Ask "Enter your E*TRADE Consumer Secret:"
Account ID: Ask "Enter your E*TRADE Account ID (or leave blank to get it after OAuth):"
Step 3: Save configuration
Create/update ~/.clawback/config.json with the provided values:
{
"broker": {
"adapter": "etrade",
"environment": "<sandbox or production>",
"credentials": {
"apiKey": "<consumer_key>",
"apiSecret": "<consumer_secret>"
}
},
"trading": {
"accountId": "<account_id>",
"initialCapital": 50000,
"tradeScalePercentage": 0.01,
"maxPositionPercentage": 0.05,
"dailyLossLimit": 0.02
},
"notifications": {
"telegram": {
"enabled": true,
"useOpenClaw": true
}
},
"congress": {
"dataSource": "official",
"pollIntervalHours": 24,
"minimumTradeSize": 10000
}
}
Step 4: Confirm setup
Tell the user: "Configuration saved to ~/.clawback/config.json. Run /clawback status to verify."
Direct user to: https://developer.etrade.com
~/.clawback/config.json{baseDir}To check if the user has configured credentials, read ~/.clawback/config.json:
The CLI automatically reads from ~/.clawback/config.json for all operations.
Before running /clawback status or /clawback run, verify:
{baseDir}/venv exists (dependencies installed)~/.clawback/config.json exists with non-empty broker.credentials.apiKeyIf either is missing, suggest running /clawback setup first.
ClawBack tracks stock trades disclosed by members of Congress (House and Senate) and executes scaled positions in your E*TRADE brokerage account. Built on the premise that congressional leaders consistently outperform the market due to informational advantages.
ClawBack monitors these politicians by default (configurable):
| Politician | Chamber | Priority |
|---|---|---|
| Nancy Pelosi | House | 1 (highest) |
| Dan Crenshaw | House | 2 |
| Tommy Tuberville | Senate | 2 |
| Marjorie Taylor Greene | House | 3 |
| Parameter | Default | Description |
|---|---|---|
| Trade Delay | 3 days | Wait after disclosure before trading |
| Holding Period | 30 days | Target hold time for positions |
| Position Size | 5% | Max allocation per trade |
| Stop-Loss | 8% | Per-position stop-loss |
| Portfolio Drawdown | 15% | Max portfolio loss before halt |
| Disclosure Checks | 10:00, 14:00, 18:00 ET | Daily check times |
| 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.
# Install from ClawHub registry
clawhub install clawback
# Or install from local directory
clawhub install ./clawback
After installation via ClawHub, the install.sh script runs automatically:
If you skip setup during installation, run it manually:
cd ~/.openclaw/skills/clawback
./setup.sh # Interactive setup wizard
# or
clawback setup # CLI-based setup
The setup wizard guides you through configuration:
After setup, credentials are stored in .env:
# E*TRADE API (required)
BROKER_API_KEY=your_consumer_key_here
BROKER_API_SECRET=your_consumer_secret_here
BROKER_ACCOUNT_ID=your_account_id_here
# Telegram (optional)
TELEGRAM_BOT_TOKEN=your_bot_token_here
TELEGRAM_CHAT_ID=your_chat_id_here
# FMP API (optional)
FMP_API_KEY=your_fmp_api_key_here
# Use the installed CLI command
clawback run # Start interactive trading mode
clawback daemon # Run as background service
clawback status # Check system status
clawback setup # Re-run setup wizard
clawback test # Test Telegram notifications
The clawback daemon command runs continuously with:
ClawBack currently only supports ETRADE. The adapter pattern allows for future broker support, but only ETRADE is implemented and tested.
| Broker | Adapter | Status |
|---|---|---|
| E*TRADE | etrade_adapter.py | Supported |
For manual E*TRADE authentication outside the main CLI:
# Standalone OAuth authentication script
cd {baseDir}
source venv/bin/activate
python scripts/auth_script.py
This generates an authorization URL, prompts for the verification code, and completes authentication.
| File | Purpose |
|---|---|
~/.clawback/config.json | Main configuration |
~/.clawback/.access_tokens.json | E*TRADE OAuth tokens |
~/.clawback/data/trading.db | SQLite database |
.env fileTrading involves substantial risk of loss. This software is for educational purposes only. Past congressional trading performance does not guarantee future results. Always test with E*TRADE sandbox accounts before live trading.