بنقرة واحدة
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 المهني
| 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 loggingInstitutional-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.