Version - 0.1.0 - This is hobbyist client side agentic trading package (builds with the allocation-manager service).
- Install dependencies:
pip install -r requirements.txt- Configure credentials:
python scripts/setup_credentials.py- Run the trading system (dry run):
python -m trading_system.main- Go live when ready:
python -m trading_system.main --liverobinhood-trading/
├── trading_system/
│ ├── main.py # 30-day breakout strategy
│ ├── data_providers/ # Market data (Twelve Data API)
│ ├── strategies/ # Trading strategies
│ ├── state/ # State management
│ └── utils/ # Metrics calculations
│
├── utils/ # Core utilities
│ ├── rh_auth.py # Robinhood authentication
│ └── safe_cash_bot.py # Cash trading bot
│
├── old_strategies/ # Legacy strategies (reference)
├── scripts/ # Utility scripts
└── docs/ # Additional documentation
For detailed structure, see PROJECT_STRUCTURE.md
30-Day Breakout Strategy:
- Buy when price hits 30-day low
- Sell when price hits 30-day high
- Tracks: BTC, S&P 500 (SPY), QQQ, AMZN
- Persistent state management
- Market data from Twelve Data API
Usage:
# Single run (dry run)
python -m trading_system.main
# Live trading
python -m trading_system.main --live
# Continuous mode (every 5 minutes)
python -m trading_system.main --continuous
# Custom interval (every 10 minutes)
python -m trading_system.main --continuous --interval 10Full Guide: TRADING_SYSTEM_GUIDE.md
# Setup credentials
python scripts/setup_credentials.py
# List accounts
python scripts/list_accounts.py
# Place single order
python scripts/place_single_order.py
# Verify account isolation
python scripts/verify_isolation.py# Momentum strategy (moving averages)
python old_strategies/momentum_strategy.py
# After-hours strategy
python old_strategies/afterhours_daily_strategy.pyBefore Running -
- Never commit
.envto git - Enable 2FA on your Robinhood account
- Use
chmod 600 .envfor restrictive permissions - Dry run mode by default
- Account isolation (locked to 490706777)
- Cash-only trading (no margin)
- 10-second countdown before live trading
# Robinhood Credentials
RH_AUTO_EMAIL=your_email@example.com
RH_AUTO_PASSWORD=your_password
RH_AUTOMATED_ACCOUNT_NUMBER=490706777
# Twelve Data API (for trading_system)
TWELVE_DATA_API_KEY=your_api_key_hereState Management:
- Persistent state in
trading_state.json - Tracks all metrics per symbol
- Records queued and active orders
- Maintains order history
This is a mess right now, working on clean-up
# Test Twelve Data API
python trading_system/data_providers/twelve_data.py
# Test metrics calculation
python trading_system/utils/metrics.py
# Test strategy logic
python trading_system/strategies/breakout_strategy.py
# Test state management
python trading_system/state/state_manager.pyfrom utils.rh_auth import RobinhoodAuth
from utils.safe_cash_bot import SafeCashBot
import robin_stocks.robinhood as r
# Login
auth = RobinhoodAuth()
auth.login('automated')
# Use safe cash bot
bot = SafeCashBot()
bot.get_portfolio_summary()
# Logout
auth.logout()- TRADING_SYSTEM_GUIDE.md m
- PROJECT_STRUCTURE.md
- docs/ - Additional documentation
- Python 3.7+
- robin-stocks >= 3.0.0
- python-dotenv >= 1.0.0
- pyotp >= 2.9.0
- requests >= 2.31.0
Install all: pip install -r requirements.txt
- Setup (one-time):
pip install -r requirements.txt
python scripts/setup_credentials.py- Test in dry run:
python -m trading_system.main- Review state:
cat trading_state.json- Go live:
python -m trading_system.main --live- Run continuously:
python -m trading_system.main --live --continuousTwelve Data Free Tier:
- 8 calls/minute
- 800 calls/day
- System uses ~12 calls per run (4 symbols × 3 calls)
Usage Limits:
- Continuous mode: 5+ minute intervals
- Daily limit: ~66 runs
Version: 2.0 (Modular Architecture) Last Updated: January 2025
