Technosight Investment Insights
Simulation Architecture

Quantitative Backtesting Methodology & Simulation Engine Reference

An institutional reference guide to the simulation engine, execution realism, friction modeling, and risk attribution.

Target Audience: Quantitative Researchers, Risk Officers & Portfolio Managers

Key Takeaways for Investors & Traders

Strict Temporal Separation

Enforces a strict T vs T+1 execution schedule: signals generated on day T close are executed on day T+1 open.

Dual Bias Elimination

Eliminates survivorship bias by tracking point-in-time historical delistings, and eliminates look-ahead bias through lagged price arrays.

Realistic Friction Modeling

Incorporates broker commission schedules, quadratic volume-share slippage, and borrow financing costs.

Institutional Accounting

Disambiguates single-trade Entry Price from multi-fill Cost Basis (VWAP), preventing distorted P&L calculations.

Executive Summary

This document outlines the architecture, mathematical principles, execution realism models, and diagnostic frameworks governing quantitative backtesting within Technosight. The engine is engineered to eliminate survivorship and look-ahead biases, model non-linear execution frictions (commissions, bid-ask spread drag, and quadratic market impact), and enforce strict temporal separation between signal generation and trade fills.

1

Executive Summary & Foundational Principles

In quantitative finance, an investment strategy without rigorous empirical backtesting is mere conjecture. The backtesting engine simulates historical capital deployment across multi-year equity universes to measure statistical edge, drawdown severity, recovery velocity, and capacity boundaries.

graph TD
    A[Stage 1: Universe Selection & 30d ADV Liquidity] --> B[Stage 2: Signal Generation & Alpha Scoring]
    B --> C[Stage 3: 15m EMA Intraday Confirmation]
    C --> D[Stage 4: Portfolio Construction & Equal Weighting]
    D --> E[Stage 5: Execution Simulation & Slippage Drag]
    E --> F[Stage 6: Delisting Liquidation & Terminal Accounting]
    F --> G[Tearsheet Diagnostic Reports: report.html & analysis.html]

Core Methodological Objectives

  1. Simulation Fidelity vs. Execution Realism: Many naive backtesters assume orders fill instantaneously at closing prices with zero fees. Technosight enforces institutional realism: orders execute on next-day opens ($T+1$), incur per-share commissions, and suffer market impact proportional to order size relative to bar volume.
  2. Survivorship Bias Defense: Backtesting only against companies currently listed in major indices introduces massive positive bias. The engine tracks point-in-time index constituents and incorporates delisted securities, capturing bankruptcies, mergers, and distressed liquidations.
  3. Look-Ahead Bias Defense: Indicator calculations at day $T$ close are strictly barred from accessing any information from $T+1$ onwards.
2

Execution Schedule & Lifecycle (T vs. T+1)

The simulation enforces strict temporal sequencing matching live production desk operations:

sequenceDiagram
    participant Market as US Market (EOD & 15m)
    participant Engine as Alpha Signal Engine
    participant Portfolio as Portfolio Constructor
    participant Sim as Execution Simulator

    Note over Market,Sim: TRADING DAY T
    Market->>Engine: 16:00 EST Market Close (EOD Data Finalized)
    Engine->>Engine: Compute Alpha Scores & 15m EMA Alignment
    Engine->>Portfolio: Filter Long/Short Candidates & Weight Targets
    Portfolio->>Sim: Stage Orders for Next-Day Open

    Note over Market,Sim: TRADING DAY T+1
    Market->>Sim: 09:30 EST Market Open (Actual Execution)
    Sim->>Sim: Apply Volume Share Quadratic Slippage
    Sim->>Sim: Deduct Broker Commissions ($0.0035/share)
    Sim->>Portfolio: Update Position Holdings & Cash Balance
  • Day $T$ Close (16:00 EST): Daily OHLCV data is finalized. Strategies compute indicators, evaluate EMA trend filters, and output target allocations.
  • Day $T+1$ Open (09:30 EST): Orders execute at the official opening print of Day $T+1$. Slippage is calculated based on Day $T+1$ opening volume participation.
3

Universe Selection & Liquidity Bounds

Before strategy signals are evaluated, the historical universe is filtered through liquidity gates:

30-Day Average Dollar Volume (ADV) Filtering

Equities must exceed minimum liquidity thresholds over the preceding 30 trading days:

$$\text{ADV}_{30, i}(t) = \frac{1}{30} \sum_{k=0}^{29} (P_{i, t-k} \cdot V_{i, t-k})$$

The engine supports seven distinct liquidity tranches (Groups A through G), ranging from USD 10M up to > USD 1.0B. Restricting simulation to specific tranches ensures that reported returns reflect deployable institutional capacity.

Delisting Tracking

If an asset is acquired, privatized, or files for Chapter 11 bankruptcy during the backtest window, the engine identifies the delisting event and forces liquidation at the final traded print or salvage value.

4

Portfolio Construction & Risk Constraints

The simulation engine applies institutional portfolio construction rules:

Equal-Weight Allocation & Concentration Limits

Capital is partitioned equally across top conviction candidates:

$$w_i = \min\left(\frac{1}{N_{\text{active}}}, w_{\text{max}}\right) \quad (w_{\text{max}} = 0.05 \text{ or } 5\%)$$

If total target allocation exceeds 100% of available capital, weights are scaled downward proportionally:

$$w_i' = \frac{w_i}{\sum_{j} w_j}$$

Trailing Stop-Loss Mechanics

Each open position is monitored daily against a ratcheting trailing stop. If an equity's closing price crosses below its stop level ($P_t < \text{Stop}_t$), the position is flagged for liquidation on the next morning's market open.

Zombie Position Mitigation

Positions that lose liquidity or experience halted trading are audited post-rebalance, ensuring that capital is not trapped indefinitely in stale positions.

5

Execution Simulation & Friction Modeling

The simulation applies realistic transaction costs and market frictions:

Broker Commission Schedule (Interactive Brokers Tiered Model)

  • Per-Share Fee: USD 0.0035 per share.
  • Minimum Ticket Charge: USD 1.00 per order.
  • Maximum Cap: 1.0% of total trade value.

$$\text{Commission} = \min\left(\max(1.00, \text{Shares} \times 0.0035), 0.01 \times \text{Trade Value}\right)$$

Market Impact & Slippage (VolumeShareSlippage Model)

Orders execute with quadratic price impact based on the fraction of the bar's volume consumed:

$$\Delta P = P_{\text{open}} \cdot c_{\text{impact}} \cdot \left(\frac{\text{Order Volume}}{\text{Bar Volume}}\right)^2$$

Where $c_{\text{impact}} = 0.05$, and order size is capped at a maximum of 20% of the bar's traded volume (volume_limit = 0.20). If an order exceeds 20% of volume, the remaining shares are queued across subsequent trading days.

6

Delisting Liquidation & Accounting Disambiguation

Entry Price vs. Cost Basis (VWAP) Disambiguation

A common error in naive accounting is conflating the initial trade execution price with the portfolio cost basis:

Dimension Initial Entry Price Portfolio Cost Basis (VWAP)
Definition The price at which the initial position fill occurred. The volume-weighted average price across all accumulated fills.
Mathematical Formula $P_{\text{entry}} = P_{\text{fill}, 1}$ $\text{VWAP} = \frac{\sum_{k=1}^M (P_{\text{fill}, k} \cdot Q_k)}{\sum_{k=1}^M Q_k}$
Operational Impact Used for technical stop-loss calculations relative to entry. Used for true portfolio P&L and tax accounting.

Case Study: Multi-Fill Position Scaling

Consider an initial purchase of 100 shares at $100.00 on Day 1, followed by a secondary fill of 100 shares at $110.00 on Day 2:

  • Initial Entry Price remains fixed at $100.00.
  • Cost Basis (VWAP) updates to $\frac{(100 \times 100) + (100 \times 110)}{200} = \$105.00$.
  • If the current price is $125.00, total unrealized gain is $(125 - 105) \times 200 = \$4,000.00$ (+19.05% return on invested capital).
7

Comprehensive Glossary of Quantitative Metrics

The simulation tearsheets report standardized institutional performance metrics:

Metric Name Formula / Definition Operational Interpretation
Sharpe Ratio $\text{Sharpe} = \frac{\bar{R}_p - R_f}{\sigma_p} \cdot \sqrt{252}$ Excess return per unit of total risk. Values $> 1.0$ indicate solid edge; $> 2.0$ indicates exceptional performance.
Sortino Ratio $\text{Sortino} = \frac{\bar{R}_p - R_f}{\sigma_{\text{down}}} \cdot \sqrt{252}$ Excess return penalizing only downside volatility ($\sigma_{\text{down}}$), ignoring upside variance.
CAGR $\text{CAGR} = \left(\frac{V_{\text{final}}}{V_{\text{initial}}}\right)^{1 / Y} - 1.0$ Compound Annual Growth Rate over $Y$ years of simulation.
Maximum Drawdown $\text{Max DD} = \max_{t} \left(\frac{\text{Peak}_t - V_t}{\text{Peak}_t}\right)$ Maximum peak-to-trough capital loss. Measures worst-case historical equity decline.
Calmar Ratio $\text{Calmar} = \frac{\text{CAGR}}{|\text{Max DD}|}$ Annualized return relative to maximum drawdown. Values $> 1.5$ indicate resilient recovery.
Value at Risk (VaR) $P(R_t < -\text{VaR}_\alpha) = \alpha$ 95% or 99% parametric loss boundary over a 1-day horizon.
Conditional VaR (CVaR) $\text{CVaR}_\alpha = E[R_t \mid R_t \le -\text{VaR}_\alpha]$ Expected Shortfall: average loss incurred on days when VaR threshold is breached.
Jensen's Alpha ($\alpha$) $\alpha = R_p - [R_f + \beta (R_m - R_f)]$ Annualized idiosyncratic return uncorrelated with benchmark market beta.
Beta ($\beta$) $\beta = \frac{\text{Cov}(R_p, R_m)}{\text{Var}(R_m)}$ Systematic sensitivity to market index fluctuations.
Win Rate $\text{Win Rate} = \frac{N_{\text{profitable trades}}}{N_{\text{total trades}}}$ Percentage of closed round-turn trades generating positive net profit.
Profit Factor $\text{Profit Factor} = \frac{\sum \text{Gross Profits}}{\sum |\text{Gross Losses}|}$ Ratio of total gross dollars won to total gross dollars lost. Values $> 1.5$ indicate profitable viability.