Skip to content
All library documents

Protecting Windows Backtests and Optimizing ATR-RSI Parameters

Article vn.py community

Summary

This example configures a futures backtest in vn.py with one-minute data, a defined date range, trading costs, contract settings, and an ATR-RSI strategy. It then uses the engine’s optimization setting to search over RSI length and entry parameters, selecting the run with the highest ending balance. The central implementation point is the main-module guard, which protects the entry point when Python starts worker processes on Windows.

The document gives configuration code and parameter ranges, but it does not report optimization results or explain how the engine obtains historical bars. Its heading about protection and its closing question about a hidden database call suggest the author is troubleshooting execution and data loading rather than presenting a complete research workflow. The example also leaves out validation on unseen data, so optimizing for ending balance over the stated sample alone does not establish that the chosen parameters will generalize.

Key ideas

  • A main-module guard is needed to protect multiprocessing entry points on Windows.
  • The example backtests an ATR-RSI strategy on an equity index futures contract.
  • The optimization searches RSI length and entry settings using ending balance as its objective.
  • The document does not identify the historical data-loading call or provide out-of-sample validation.

Tags

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