tradermonty/claude-trading-skills/drawdown-circuit-breaker
- community
Checking that the SKILL.md file is still in the repository.
Evaluate account-level drawdown circuit breaker rules from trader-memory-core state and decide whether new trade risk is allowed today. Uses realized P&L, losing-streak cooldowns, and weekly/monthly drawdown limits without any external API.
Install
npx vskill@latest install tradermonty/claude-trading-skills/drawdown-circuit-breakerSKILL.md
Drawdown Circuit Breaker
Overview
Evaluate whether the trader should take new trade risk today based on account-level realized P&L and recent terminal trade outcomes. This skill reads trader-memory-core thesis YAML files only. It produces a circuit_breaker_decision artifact that complements the market-side exposure_decision from exposure-coach.
The circuit breaker is a recommendation and recordkeeping tool. It does not replace human judgment, and it does not enforce broker-side blocks or automated order rejection.
When to Use
- Before screening or sizing any new swing trade candidate
- After a losing trade or partial trim to check whether a cooldown is active
- During daily planning when trader-memory-core contains recent closed or partially closed positions
- As a workflow gate before swing-opportunity-daily proceeds to candidate generation
- When reviewing whether daily, weekly, or monthly loss limits have been breached
Prerequisites
- Python 3.9+
- Local trader-memory-core thesis YAML files, usually under
state/theses/ - Account size in dollars
- No API keys or network access required
Workflow
Step 1: Read Trader Memory State
Point the script at the thesis state directory:
The script scans every th_*.yaml file and reads realized P&L from each thesis status_history[] ledger entry. It does not use _index.json for P&L, because the index is a lightweight lookup file and does not contain the required realized-P&L ledger.
After validating each file, the script groups valid theses by the case-sensitive, whitespace-trimmed thesis_id. If two or more valid files share an ID, it excludes the entire duplicate group from P&L and losing-streak calculations, reports every actual source path, and returns PARTIAL + HALTED until the duplicate state is repaired and the decision is rerun. metrics.theses_scanned counts only accepted theses with unique IDs.
If the state directory is missing or is an empty directory, the skill returns TRADING_ALLOWED with data_quality: EMPTY_STATE so a new user is not blocked by the absence of history. If the configured state path exists but is not a directory, the skill fails closed as incomplete state data.
If state exists but a thesis, ledger event, or terminal result must be skipped or conflicts with another recorded value, the skill fails closed with data_quality: PARTIAL, recommendation: HALTED, and an incomplete_state_data rule. Repair the warnings and rerun before taking new risk. The one recoverable exception is a finite terminal outcome.pnl_dollars fallback for a legacy thesis with no realized-P&L ledger entry; it remains visible as PARTIAL but does not by itself override the calculated recommendation. For ACTIVE, PARTIALLY_CLOSED, CLOSED, and INVALIDATED theses, each history event must be an object with a recognized status and parseable at, and the last history status must match the thesis status. ACTIVE and PARTIALLY_CLOSED theses must also carry entry actuals; PARTIALLY_CLOSED must carry a position. Malformed, stale, or skeletal lifecycle history disqualifies terminal fallback and halts. Ledger-shaped events whose realized_pnl is missing, untyped, or non-finite also halt instead of being coerced.
Step 2: Evaluate Circuit Breaker Rules
The default rules are:
| Rule | Default | Triggered State | Release | |
|---|---|---|---|---|
| Max daily loss | 2.0% of account | HALTED | Next ET weekday | |
| Losing streak cooldown | 2 terminal losing theses | COOLDOWN | 24 hours after latest loss exit | |
| Weekly drawdown halt | 5.0% of account | HALTED | Next Monday ET | |
| Monthly drawdown halt | 8.0% of account | HALTED | First day of next month ET |
Day, week, and month boundaries use America/New_York. Date-only producer timestamps from trader-memory-core are counted on the named ET date. Set --as-of for deterministic evaluation; date-only --as-of values cover the full ET day, while timestamp values exclude future events after that time:
Step 3: Override Thresholds When Needed
Override individual thresholds on the CLI:
Or provide a JSON config file:
CLI arguments override config-file values.
Step 4: Interpret the Decision
Use the generated decision as a gate for new trade risk:
| Recommendation | Meaning | |
|---|---|---|
| TRADING_ALLOWED | No circuit breaker rule is active; new trade risk may proceed through the rest of the workflow | |
| COOLDOWN | Do not open new positions; continue managing existing positions and review the recent losses | |
| HALTED | Stop new entries because a drawdown limit is active or account-state data is incomplete; repair/rerun any data warnings before proceeding |
Existing position management remains a human decision. The circuit breaker is designed to prevent new risk escalation after realized damage, not to force liquidation.
Time-based rules carry an ISO 8601 active_until. The non-time-based incomplete_state_data rule uses active_until: null; its Markdown report says the halt lasts until the state is repaired and the decision is rerun.
Output Format
The script writes circuit_breaker_decision_YYYY-MM-DD_HHMMSS.json and, unless --json-only is set, a matching markdown report.
Exchange Calendar Contract
Install requirements.txt before running the checker. Daily, weekly, and monthly halt dates use actual XNYS sessions. active_until remains compatible: the halt ends at 00:00 America/New_York on the next eligible session date, not at that session's opening bell. Use --as-of for deterministic evaluation.
Resources
scripts/check_circuit_breaker.py- Main CLI and rule enginereferences/circuit_breaker_framework.md- Rule definitions, defaults, and data-source notesskills/trader-memory-core/schemas/thesis.schema.json- Source schema for thesis state
Key Principles
- Realized damage only - Use recorded realized P&L, not unrealized P&L or thesis-level cumulative fields for daily calculations.
- Survival first - A circuit breaker exists to prevent escalation after losses.
- Advisory, not automatic execution - The output informs the workflow gate; it does not place, cancel, or block broker orders.
- Fail closed on incomplete state - Empty state allows a new user to begin, but malformed, discarded, conflicting, or non-finite risk data returns
PARTIAL+HALTEDwithout crashing. A finite legacy outcome fallback is reported as recoverablePARTIALand remains non-blocking.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/drawdown-circuit-breaker/SKILL.md
Popularity
- Repository stars
- 2,745
- Repository forks
- 630
- 7-day trend score
- 40
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tradermonty/claude-trading-skills/drawdown-circuit-breaker)