一键导入
trading-risk-gates
Risk guardrails that must survive any CLI, strategy, or live-loop change — drawdown caps, daily trade caps, position sanity, leverage clamps.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Risk guardrails that must survive any CLI, strategy, or live-loop change — drawdown caps, daily trade caps, position sanity, leverage clamps.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use the pinned external CocoIndex Code MCP workflow for broad repository routing, then prove exact candidates with rg and direct file reads.
Bound repository context reads and semantic-search output without weakening source, test, or evidence verification.
Choose staged contract tests that catch partial AI-generated fixes across models, data, risk, execution ownership, and CLI/Windows parity.
Keep concise user docs and machine-readable model evidence synchronized with real behavior without losing provenance or caveats.
Apply four anti-error coding principles plus this repository's stricter financial-evidence, safety, and single-session rules.
Research the existing implementation, tests, primary technical sources, and financial rationale before adding trading code or dependencies.
| name | trading-risk-gates |
| description | Risk guardrails that must survive any CLI, strategy, or live-loop change — drawdown caps, daily trade caps, position sanity, leverage clamps. |
| origin | repo-local skill for simple_ai_trading |
Use this skill whenever you touch the backtest engine, the live loop, the strategy profile table, or anything downstream of _build_order_notional / _paper_or_live_order.
min(strategy.leverage, client.get_max_leverage(symbol), MAX_AUTONOMOUS_LEVERAGE), where the app cap is 20x, before any order submission. A bug that submits uncapped leverage is a security-class incident — add a regression test.cfg.max_drawdown_limit. When 0 < limit ≤ drawdown, stop entering new positions and emit a stopped_by_drawdown marker. Do not swallow this signal silently.cfg.max_trades_per_day > 0 is enforced per-UTC-day. A value of 0 is an explicit opt-out (no cap) and must be tested as such.cfg.max_open_positions defaults to the three supported major assets. Any path that exceeds the configured cap or opens an unsupported symbol is a bug.testnet=True is required before any authenticated live run. Add a preflight that fails loud if someone disables it.reduceOnly=true for any close / emergency-close on futures.newOrderRespType=RESULT on futures so the response includes a fill price we can persist.order_error artifacts; do not let raw BinanceAPIError escape the loop._build_order_notional. That function is the single source of truth for sizing.