Skip to content
All library documents

Event-Driven Backtesting of Daily Equity Strategies in VeighNa

Article vn.py community

Summary

This tutorial explains how VeighNa’s backtesting engine replays historical daily bars to evaluate an equity strategy. It walks through configuring instruments, interval, dates, and initial capital; attaching a strategy and dated signal table; loading data; running the replay; and calculating daily results, statistics, and charts. During each date’s event, the engine prepares bar data, attempts to fill earlier orders, calls the strategy, and records closing prices for mark-to-market accounting.

The article also describes how target positions become orders, how adjusted order prices affect simulated fill chances, and how contract settings supply fees and instrument details. It lists reported measures such as net profit and drawdown, while emphasizing that results depend on alignment between signals and market dates, available data, costs, and fill assumptions. The tutorial provides an implementation workflow and troubleshooting checks, but no strategy performance results; simulated fills and costs may not capture real execution conditions.

Key ideas

  • The engine advances through historical trading dates and triggers strategy callbacks as market events.
  • Existing orders are matched before the strategy handles the current day’s bars and creates new orders.
  • Signals must align with replay dates and the instrument universe for the strategy to receive them.
  • Daily profit and loss reflects trades, closing prices, holdings, and configured transaction costs.
  • Backtest statistics describe the whole portfolio process and depend on data and execution assumptions.

Tags

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