Skip to content
All library documents

Event-Driven Backtesting: Naive Portfolio Position and Order Management

Article FMZ forum · Author: 善

Summary

This article describes a portfolio component for an event-driven backtester. A portfolio receives signal events, produces order events, and updates positions and holdings from fill events. The NaivePortfolio example tracks each symbol’s quantity, cash, commissions, and total account value over time. It estimates holdings using the latest bar’s closing price, records snapshots, and creates a normalized equity curve and return series.

Orders use a fixed quantity scaled by signal strength, with logic for opening long or short positions and exiting them. The author explicitly characterizes this approach as elementary: it does not account for available cash, realistic bid-ask prices, liquidity, risk controls, or more considered position sizing. Closing prices approximate liquidation value and can be especially unrepresentative for daily strategies. The article explains architecture and implementation concepts but provides no strategy results or validation evidence; later articles are said to add risk management and execution handling.

Key ideas

  • A portfolio module converts signals into orders and updates positions when fills arrive.
  • Position and holdings histories can be recorded at each market data update.
  • The example values open positions using the latest bar’s close and tracks cash, commissions, and equity.
  • Fixed-quantity orders make the example unsuitable as a realistic risk-managed portfolio model.
  • The resulting equity curve supports return analysis but does not itself validate a strategy.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.