What problem does it solve?
Autonomous paper trading systems generate state data (account balances, positions, executed actions) on every tick, but manually saving, aggregating, and cleaning up this data is error-prone and time-consuming, risking lost trading history and cluttered local storage.
Core Features & Use Cases
- Per-Tick Snapshots: Automatically saves a full snapshot of Alpaca account state, positions, and trading actions for every master_trading tick.
- Automated Rollups: Aggregates daily tick snapshots into daily rollups and weekly daily rollups into weekly summaries for easy performance tracking.
- Configurable Pruning: Automatically removes per-tick snapshots older than a configurable retention window to save disk space, with all data stored locally in gitignored directories for operator privacy.
- Use Case: For anyone running an autonomous Alpaca paper trading system, this skill ensures no trading state is lost, performance metrics are aggregated automatically, and old snapshots are cleaned up without manual work.
Quick Start
Invoke the state_persistence skill at the end of each master_trading tick to automatically save the current trading state, generate applicable daily and weekly rollups, and prune outdated snapshots.