Select Your Operating System
Terminal commands, shell scripts, and scheduling utilities adjust dynamically.
Set Up Python Environment & Market Libraries
Create a virtual environment and install yfinance, pandas, pydantic, and requests.
Install Required Packages
Initialize your workspace and install financial time-series packages:
Paste output from pip list confirming yfinance, pandas, and pydantic:
Fetch Chart Candlesticks & Manage Crumb Authentication
Query Yahoo Finance v8 chart endpoint with browser headers to extract timestamped OHLCV series.
API Connection Script
Query ticker candles with custom headers and inspect the response payload:
Run python fetch_candles.py and paste output confirming Status Code: 200 and candles retrieved:
Normalize Market Data with Pydantic Models
Parse raw timestamp arrays into strongly-typed, validated OHLCVCandle records.
Candle Schema
Build an OHLCVCandle schema that enforces price bounds and cleans missing volume flags:
Paste terminal output from running python models.py showing validated OHLCVCandle model:
Compute Technical Indicators (SMA & RSI)
Calculate 20-day Simple Moving Average and 14-day Relative Strength Index on historical price bars.
Technical Analysis Module
Compute rolling momentum and trend indicators using vector operations in Pandas:
Paste terminal output from python indicators.py showing computed sma_20 and rsi_14 columns:
Multi-Ticker Portfolio Batch Collector
Execute batch gathering across equities, ETFs, and cryptocurrencies with respectful delays.
Batch Collector Script
Iterate across an asset watchlist with randomized jitter to respect server bandwidth:
Paste terminal output from python batch_collector.py confirming completed tickers:
SQLite Time-Series Database & Market Close Automation
Store historical candles with composite primary keys and schedule daily automated runs.
Database Setup
A composite primary key on (ticker, timestamp) guarantees idempotent storage of market bars:
Run It Later: Scheduled Market Close Collector
Configure automated collection to record finalized daily candle bars every weekday after market close (4:15 PM EST):
Paste terminal output from initializing market_data.db:
Build Bot Better & Wipe Resistance
Apply profile and workspace protections so an agent cannot casually wipe your home folder or project data. Fleet rule: Hub conversation #31.
An autonomous agent running without boundary constraints executed a recursive delete targeting the user profile. Prompt rules and command-text deny lists (like rm or Remove-Item) fail when paths are passed inside variables or child scripts. BuildBotsBetter requires the complete defense trio: PreToolUse path inspection, off-volume backups, and a practised restore.
1. Per-Agent Onboarding Checklist (Run Once Per Agent)
Onboarding does not end when software installs. Generate and maintain a six-line checklist file for each agent operating on your system:
2. Variable-Limit Delete Guard Demo
Demonstrate why command-text pattern matching misses variable-derived deletions, while true path resolution catches and refuses them:
3. Off-Volume Profile & Data Backup
Back up collected stock history CSVs, indicator databases, and collector settings off the OS volume:
4. Practised Restore Drill
Never trust an unverified backup. Run this safe, self-contained restore drill inside your temp folder:
5. Fail-Closed Workspace Policy
Never run automated cron collectors or nightly ticker ingestion jobs from the home directory. Restrict collector daemons to dedicated repository workspaces.
Paste terminal output from the restore drill or variable demo confirming protection: