BacktestLoop turns plain-English trading ideas into editablePython backtests.
Generate strategy code, run it on historical stock, futures, forex, or crypto data, then inspect trades, equity curves, logs, drawdowns, and risk metrics. It is built for traders and quant builders who want a faster research loop without setting up their own data and backtesting pipeline.
Hey Product Hunt 👋
I built BacktestLoop because testing trading ideas is still way more annoying than it should be.
Usually, you either need to write the whole strategy yourself, wire up historical data, handle indicators/timeframes/fees, debug the backtest engine, and then figure out whether the result is actually trustworthy — or you use a no-code tool that hides too much of the logic.
BacktestLoop is my attempt at a faster research loop:
1. Describe a trading strategy in plain English
2. Generate editable Python strategy code
3. Run the backtest on historical stocks, futures, forex, or crypto data
4. Inspect the trades, logs, equity curve, drawdown, and risk metrics
5. Iterate from there
The key thing is that it is not a black box. The generated code is visible and editable, so you can inspect what is actually being tested.
Important note: BacktestLoop is research software only. It is not a signal service, not a brokerage, not copy trading, and not investment advice.
I’d love feedback from traders, Python users, quant builders, and anyone who has tried to backtest strategies before.
Report
the part i'd worry about is overfitting from the iteration loop itself. if someone tweaks the prompt and reruns against the same historical window ten times until the equity curve looks good, that's curve fitting even though each individual run is honest backtrader code. does backtestloop do anything to nudge people toward out-of-sample testing, or is that on the user to enforce themselves
Report
Maker
@galdayan Yes the agent will guide the user to test the startegy on different date ranges / tickers / timeframes as well. Additionally we are currently adding a feature which will automatically analyze the strategy on many different out-of-sample market data date ranges / tickers / timeframes in parallel and test the profitability on out-of-sample data as well automatically.
We also plan to make this fully configurable / overridable via the user interface such that the user can decide the rules on how the agent should pick the date ranges / tickers / other parameters (like timeframe etc) for the out-of-sample testing (more advanced users might want to pick their own rules on this so we are planning to make it configurable)
Report
How does the generated Python code actually hold up if I want to swap in my own custom dataset or tweak the strategy logic after the fact, is it cleanly structured or more of a black box?
Report
Maker
@eminenv9f It's plain vanilla Python code for the Backtrader engine (which is open source), a normal bt.Strategy subclass, nothing proprietary you'd have to learn. You can inspect a real example here without signing up: https://app.backtestloop.com/strategy/oWK42LP1MOTepzwftbsKVA (click the Code tab, that's the actual file that ran).
Editing after the fact works both ways: change the Python yourself in the editor and re-run, or tell the agent what to change and it edits the file. For data, backtests currently run on our built-in market data (stocks, futures, crypto, forex, 1-second to weekly bars) - uploading your own dataset isn't supported yet but it's on our list.
In the meantime, since it's standard Backtrader, you can also copy the code out and run it on your own data locally.
Report
Would love to see a way to compare two strategy runs side by side in the same view. Right now I can run a backtest, tweak the prompt, and run again, but flipping between tabs to compare equity curves and drawdowns makes it hard to judge if a change actually helped. An overlay or a split comparison would make iteration much faster.
This is a really great idea. Thank you for the feedback. We will add this.
However we already have a feature that you can use for quickly going back to the previous version of the same strategy if you are iterating on the same strategy using this dropdown:
It allows you to see the previous version of the given strategy and even to revert it to a previous state if the updated results are not satisfactory (as you iterate on it with the agent)
Additionally you can check the previous strategies with this tab on the chat:
If you click on one of them it loads it on the right so you can quickly switch between them to compare.
But the side by side comparison is a really nice idea so we will add this soon as well.
Report
No reviews yetBe the first to leave a review for BacktestLoop
the part i'd worry about is overfitting from the iteration loop itself. if someone tweaks the prompt and reruns against the same historical window ten times until the equity curve looks good, that's curve fitting even though each individual run is honest backtrader code. does backtestloop do anything to nudge people toward out-of-sample testing, or is that on the user to enforce themselves
@galdayan Yes the agent will guide the user to test the startegy on different date ranges / tickers / timeframes as well. Additionally we are currently adding a feature which will automatically analyze the strategy on many different out-of-sample market data date ranges / tickers / timeframes in parallel and test the profitability on out-of-sample data as well automatically.
We also plan to make this fully configurable / overridable via the user interface such that the user can decide the rules on how the agent should pick the date ranges / tickers / other parameters (like timeframe etc) for the out-of-sample testing (more advanced users might want to pick their own rules on this so we are planning to make it configurable)
How does the generated Python code actually hold up if I want to swap in my own custom dataset or tweak the strategy logic after the fact, is it cleanly structured or more of a black box?
@eminenv9f It's plain vanilla Python code for the Backtrader engine (which is open source), a normal bt.Strategy subclass, nothing proprietary you'd have to learn. You can inspect a real example here without signing up: https://app.backtestloop.com/strategy/oWK42LP1MOTepzwftbsKVA (click the Code tab, that's the actual file that ran).
Editing after the fact works both ways: change the Python yourself in the editor and re-run, or tell the agent what to change and it edits the file. For data, backtests currently run on our built-in market data (stocks, futures, crypto, forex, 1-second to weekly bars) - uploading your own dataset isn't supported yet but it's on our list.
In the meantime, since it's standard Backtrader, you can also copy the code out and run it on your own data locally.
Would love to see a way to compare two strategy runs side by side in the same view. Right now I can run a backtest, tweak the prompt, and run again, but flipping between tabs to compare equity curves and drawdowns makes it hard to judge if a change actually helped. An overlay or a split comparison would make iteration much faster.
@kathleencl1409
This is a really great idea. Thank you for the feedback. We will add this.
However we already have a feature that you can use for quickly going back to the previous version of the same strategy if you are iterating on the same strategy using this dropdown:
It allows you to see the previous version of the given strategy and even to revert it to a previous state if the updated results are not satisfactory (as you iterate on it with the agent)
Additionally you can check the previous strategies with this tab on the chat:
If you click on one of them it loads it on the right so you can quickly switch between them to compare.
But the side by side comparison is a really nice idea so we will add this soon as well.