Skip to content

Shadow Core Abstractions

This page defines the engine-level concepts that should stay stable as shadow combines multiple components into one workflow.

Account

An account represents the portfolio state and capital context for a run.

Typical responsibilities include:

  • initial capital and cash management
  • portfolio-level constraints
  • fee and slippage settings
  • benchmark and accounting context
  • holdings lifecycle across rebalance dates

Position

A position represents holdings in one instrument within one account.

Typical fields or behaviors include:

  • instrument identifier
  • quantity or weight
  • cost basis
  • current mark-to-market value
  • realized and unrealized PnL
  • holding period and turnover contribution

Trade

A trade is the executable change between positions over time.

Typical trade concerns include:

  • target versus current exposure
  • order direction and size
  • execution date and price assumption
  • fees, taxes, and slippage
  • partial fills or execution constraints if modeled

Strategy Spec

A strategy spec is the declarative contract that tells shadow what to run.

It should define:

  • what factor inputs are used
  • how securities are filtered, ranked, and selected
  • how positions are sized
  • when rebalancing happens
  • what execution assumptions apply
  • what outputs should be generated

Report Generator

A report generator turns a finished run into user-facing output.

Typical outputs include:

  • performance summary
  • return series
  • drawdown analysis
  • turnover and cost analysis
  • trade logs
  • position snapshots
  • industry or strategy comparison tables

Why These Abstractions Matter

These abstractions help shadow scale from single-strategy research to industry-level batch execution.

They also make it easier to:

  • compare strategies fairly
  • keep specs stable across engine upgrades
  • separate business intent from implementation details
  • generate consistent reports for both research and production review