Skip to content
All library documents

Using CSV Bars and Trade Records in VeighNa Backtests

Article vn.py community

Summary

This forum exchange explains how to run VeighNa CTA backtests with bar data held in CSV files. One approach converts CSV rows into BarData objects and assigns them directly to the engine’s history data, bypassing database loading. The bars must be sorted chronologically. If a strategy requests warm-up bars during initialization, that request may still query the database; the discussion suggests adjusting initialization or the engine’s loading method when the CSV contains sufficient history.

For repeat use and parameter optimization, the post recommends importing bars into VeighNa’s database, since multi-process optimization depends on database loading. It also distinguishes separate single-symbol backtests from a joint portfolio backtest: the CTA engine does not provide shared-funds multi-symbol testing, for which the portfolio strategy module is suggested. A follow-up explains that trade records remain in memory, can be retrieved through the engine, and can be exported for analysis. The advice is implementation-specific; users should check interface behavior against their VeighNa version.

Key ideas

  • CSV rows can be converted to bar objects and supplied directly as backtest history.
  • Bars need chronological ordering, and initialization warm-up calls may still depend on database data.
  • Importing bars into the database suits repeated runs and parameter optimization.
  • Joint multi-symbol testing with shared capital calls for a portfolio strategy engine.
  • Trade and order records can be retrieved after a run and exported for analysis.

Tags

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