一键导入
execution-hooks
Pre-trade risk gates and post-trade audit actions for institutional compliance.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Pre-trade risk gates and post-trade audit actions for institutional compliance.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Institutional-grade monitoring of alpha exhaustion, execution capacity, and regime drift.
Institutional-grade strategy validation, walk-forward analysis, and regime-aware testing.
Institutional-grade data cleaning, tick physics auditing, and gap reconstruction.
Minimizing slippage, benchmarking fills, and detecting toxic flow.
Institutional-grade management of systemic risk, hidden correlations, and black-swan stress testing.
Foundation layer for identity verification, noise filtering, and environment awareness.
| name | Execution Hooks |
| description | Pre-trade risk gates and post-trade audit actions for institutional compliance. |
This skill provides the "Gate Keeper" logic for the Titan system. All trades MUST pass through these hooks to ensure institutional-grade risk management.
Before ANY order is sent to MT5, run the pre-trade gate:
python .agent/hooks/pre_trade.py --symbol GOLD --direction BUY --lots 0.1
| Check | Purpose | Block Condition |
|---|---|---|
| HEARTBEAT | System health | Status ≠ HEALTHY |
| MACRO_FILTER | News environment | Verdict = BLOCK |
| KELLY_SIZING | Position limits | Lots > Kelly × 1.5 |
| TRADING_HOURS | Market calendar | Weekend = True |
{
"gate": "PASS" or "BLOCKED",
"checks": [...],
"reason": "Explanation if blocked"
}
If gate returns BLOCKED, you MUST:
After ANY order is filled, run the post-trade actions:
python .agent/hooks/post_trade.py --symbol GOLD --direction BUY --lots 0.1 --entry 2650.0 --filled 2650.5 --ticket 123456
| Action | Purpose |
|---|---|
| TCA_ANALYSIS | Calculate slippage and assign grade (A/B/C) |
| AUDIT_LOG | Log to institutional audit trail |
| ADAPTIVE_EXIT | Register position for dynamic management |
| NOTIFICATION | Queue alert for monitoring |
| Grade | Slippage % | Interpretation |
|---|---|---|
| A | < 0.01% | Excellent execution |
| B | 0.01% - 0.05% | Acceptable |
| C | > 0.05% | Review broker quality |
The titan_orchestrator.py automatically calls both hooks when using --action execute:
python titan_orchestrator.py --action execute --symbol GOLD --direction BUY --lots 0.1
This single command:
pre_trade.py: Risk gate before order placementpost_trade.py: TCA and audit after order fillmt5_bridge/scripts/heartbeat_monitor.py: For system healthdata_intelligence/scripts/macro_context.py: For news filterfactor_risk/scripts/dynamic_kelly_allocator.py: For sizing limitsmt5_bridge/scripts/audit_trail_manager.py: For logging