Skip to content
All library documents

Diagnosing a NumPy 2.0 Error in VeighNa CTA Backtests

Article vn.py community

Summary

This community post reports a failure in a VeighNa CTA backtest on Windows with a Tushare data service. Historical one-minute futures data downloads successfully and the strategy loads, but the run fails when the backtesting engine calculates performance statistics. The traceback points to empyrical’s downside-risk calculation, which refers to the NumPy constant NINF.

The exception states that NumPy 2.0 removed this constant and recommends using negative infinity instead. This identifies a dependency compatibility problem encountered during statistics calculation, rather than a data-download or strategy-execution failure. The post records the environment and error details, but does not provide a fix, package-version workaround, or confirmation that any proposed change resolves the issue. It is useful for locating the failure stage and understanding the compatibility cause, though it is not a complete troubleshooting guide.

Key ideas

  • The reported CTA backtest downloads historical data before failing during statistics calculation.
  • The traceback locates the error in empyrical’s downside-risk function.
  • The failure is caused by a reference to a NumPy constant removed in version 2.0.
  • The post documents the issue but offers no tested resolution.

Tags

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