QuantPipe v0.5.2 Devlog: Python Forex Backtesting Framework Refactor and Prop Firm Simulator Restoration

This release focused on fixing structural issues inside QuantPipe, the Python forex backtesting framework I've been building to simulate real prop firm evaluation conditions.

As the system grew beyond a few scripts and into a proper trading infrastructure, some of the original shortcuts started to get in the way. Things worked, but they didn't scale well. Workflows weren't unified, automation was harder than it should be, and parts of the prop firm challenge simulator had fallen out during earlier refactors.

v0.5.2 is where I started correcting that.

Moving Toward a Real Python Forex Backtesting Framework

Early versions of QuantPipe were functional, but not cohesive. Core tasks like ingesting price data, creating strategies, and running backtests existed as separate scripts. That made iteration slower and increased the chance of inconsistent results.

Everything now runs through a single CLI interface:

  • poetry run quantpipe ingest
    Converts raw forex price data into QuantPipe's internal format.

  • poetry run quantpipe scaffold
    Generates a properly structured Python strategy template.

  • poetry run quantpipe backtest
    Runs the full simulation engine against historical data.

This doesn't change strategy logic, but it makes the execution path consistent. That was a requirement before automation could work reliably.

This refactor moves QuantPipe closer to being a true Python forex backtesting framework instead of a loose collection of tools.

Restoring the Prop Firm Challenge Simulator

QuantPipe exists primarily to simulate prop firm evaluation environments, specifically City Traders Imperium (CTI).

During earlier refactors, portions of the prop firm simulator logic were temporarily removed while restructuring the engine. This release restores that functionality completely.

The simulator now properly models:

  • Maximum drawdown enforcement
  • Account failure and termination conditions
  • Challenge progression and promotion thresholds
  • Profit tracking and payout modeling
  • Challenge buyback strategy and logic

This was necessary because the simulator needs to behave the same way the prop firm does. If a strategy passes in QuantPipe but fails under actual prop firm rules, the simulation isn't useful.

GPU Acceleration Investigation

QuantPipe currently uses an 8.6 million candle test dataset, which represents roughly 80% of the total historical data for EURUSD. This dataset is used for development and performance testing of the backtesting engine.

As datasets grew into the multi-million candle range, performance became a real concern. Earlier versions of QuantPipe relied on Pandas for data preparation, and backtests against this dataset could take over 10 hours to complete.

That bottleneck was eliminated by switching to Polars.

Polars' vectorized execution reduced the same backtest runtime from 10+ hours to roughly 1.5 minutes. At that point, data preparation and indicator computation were no longer the limiting factors.

Furthermore, adding ranges for indicators, such as EMA 10–40 with a step of 5, adds no meaningful time to a single-sweep backtest.

GPU acceleration using cupy was explored, but it wasn't necessary once Polars was in place. The CPU execution path is already fast enough to run full-dataset backtests interactively.

GPU acceleration may still be useful later, but it isn't needed for normal backtesting.

What Comes Next

The next release will focus on the visualization system.

v0.6.0 will introduce true candle-by-candle replay across the full 8.6 million candle test dataset. The replay engine will render entries, exits, stops, and indicator state at each candle.

This provides a direct view into strategy execution, rather than relying only on summary output.

Being able to see strategies execute on the chart makes it much easier to understand how QuantPipe is interpreting the strategy logic.

The same system will also support forward testing in a post-v0.6.0 release, using the same execution and rendering pipeline with live market data.


Join the Discussion

What are your thoughts on this? Leave a comment below!