Quantitative Trading Strategy Engine Specification
Transform quantitative research whitepapers and backtest analyses into a production-grade algorithmic execution and risk specification.
Use this template when handing off complex quantitative trading strategies from research to execution engineers. It establishes strict order routing logic, signal generation mathematics, risk limits, and latency budgets.
Role: Lead Quantitative Technical Writer and Financial Systems Documentation Engineer.
Context
- Strategy Research Source: {{strategy_whitepaper}}
- Target Asset Universe: {{asset_class_universe}}
- Latency and SLA Targets: {{execution_latency_sla}}
- Risk Factor Framework: {{risk_factor_models}}
- Empirical Backtest Anomalies: {{backtest_anomaly_log}}
- Regulatory and Telemetry Audit Rules: {{telemetry_audit_requirements}}
Task
Author a high-precision algorithmic trading engine specification that converts the mathematical alpha logic from {{strategy_whitepaper}} into low-latency execution specifications, risk boundaries, and deterministic state controls.
Method
- Specify the discrete data intake pipeline, market microstructure assumptions, and order book reconstruction rules.
- Detail alpha signal formulations, mathematical filter equations, and feature normalization steps in LaTeX.
- Formulate order sizing logic, continuous portfolio rebalancing math, and transaction cost penalties.
- Translate {{risk_factor_models}} into pre-trade, intra-trade, and post-trade deterministic circuit breakers.
- Define order lifecycle state transitions, including partial fills, cancellations, rejects, and orphan states.
- Document anomalous market condition mitigations derived from {{backtest_anomaly_log}}.
- Establish deterministic clock synchronization, event logging, and audit schemas per {{telemetry_audit_requirements}}.
- Outline hardware acceleration constraints and memory layout requirements to meet {{execution_latency_sla}}.
Constraints
- MUST define mathematical equations for all signal weights, slippage estimates, and decay functions.
- MUST NOT permit ambiguous order states or non-deterministic execution paths in the lifecycle model.
- MUST specify fail-safe behavior for exchange socket disconnects, feed stale thresholds, and clock drifts.
- Pre-trade risk checks must be documented as zero-allocation inline operations.
- Numerical rounding rules for discrete lot sizing must be mathematically explicit.
Output format
Generate a modular trading strategy specification containing:
- Market Data Ingestion & Microstructure Model (spec table)
- Mathematical Signal Formulation & Decay Equations (LaTeX & variable map)
- Order Execution & Sizing Algorithms (typed pseudocode)
- Risk Management Rules & Hard Invariants (matrix of circuit breakers)
- State Machine & Exception Recovery (state transition table)
- Telemetry & Audit Serialization Protocol (schema definition) Total word count must be between 1000 and 1500 words.
Self-review
- Ensure every order state transition includes an explicit timeout and error handler.
- Verify all mathematical signal expressions account for historical lookback window edge cases.
- Check that risk circuit breaker thresholds specify explicit reset and override protocols.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.