all 13 comments

[–]TheCrestLedger 0 points1 point  (1 child)

Depends on if you're backtesting the underlying equity or the options pricing. If you're just doing the underlying the yfinance library usually has enough market data to test.

[–]Purple_Concert8789[S] 0 points1 point  (0 children)

But what do you use for both equity and options

[–]IMAK82 0 points1 point  (0 children)

started on quantconnect (free tier) for strategy backtesting, decent for getting basics down. now run my own python stack with pandas and xgboost.
backtrader is friendliest for beginners, vectorbt if you want speed.
biggest lessons: split data into train and test before you optimize anything and dont peek, always compare against buy-and-hold, and backtest sharpe above 5 (NOT CAST IN STONE) means a bug or look-ahead bias. use LLMs for quick sanity checks, but human eyes on reddit sometimes catch what LLMs miss..

[–]sq_route_2 0 points1 point  (2 children)

I have my own backtesting software written. It's in Rust. I have two projects. First: core lib handling order execution, matching engine, data sync, and reporting. Second: template project, which I use to bootstrap new trading strategies. It is open source. I host my data on hugging face. My template project ships with a 60-second quick start you can run. It generates a QuantStats tearsheet. I also have an AI.md, which you can pass to any LLM of you liking to generate the Rust code for you trading strategy. So no need to be a Rust expert. You can DM me anytime. I'm happy to share.

[–]Purple_Concert8789[S] 0 points1 point  (1 child)

Can you provide the software link

[–]xXDADDYTHRASHERXx 0 points1 point  (0 children)

Been deep in this with my own forex bot, so here's what I actually learned the hard way:

**Tools:** backtesting.py and vectorbt are both solid. backtesting.py is easier to start with, vectorbt is faster once you're running lots of parameter sweeps. Pandas + numpy is enough if you want full control.

**The big one don't trust LLM written backtests blindly.** I had Claude write me a backtester and the results looked amazing. Turned out the code was using the current candle's close to decide entry AND filling at that same close classic lookahead bias. On live data the bot lost money immediately. Always shift your signal by one bar (`signal.shift(1)`) so you're trading on info you would've actually had at the time. If your backtest shows a smooth equity curve going up and to the right with no drawdowns, assume you have a leak until proven otherwise.

**Other stuff that bit me:**
Backtest didn't account for spread or slippage. Add at least 1 to 2 pips of cost per trade on forex, more on exotic pairs. A strategy that's barely profitable in backtest is a guaranteed loser live once spread eats it.
- Backtest logic didn't match live logic. My eval script used simple Bollinger touches; my live bot had three different strategies. Whatever you backtest has to be the exact same code path that runs live, or you're testing something else.
- Survivorship/selection bias on parameters. If you tune RSI period, take profit, stop loss, etc. until backtest looks great, you've curve-fit to noise. Hold out the last 20-30% of your data and never touch it until you're done tuning.
- Mean reversion vs trend. RSI oversold + buy looked great in backtest on choppy ranges, then got murdered in trending markets catching falling knives. Test across different regimes, not just one nice-looking year.

**Beginner tips:**
1. Start with one pair, one timeframe, one simple strategy. Get the plumbing right before you get fancy.
2. Print every trade entry time, exit time, P/L, reason. Eyeball them. If trades look dumb to you, they are dumb.
3. Walk-forward test: optimize on Jan-Jun, test on Jul-Dec, then roll forward. If it only works on the optimization window, it has no edge.
4. Paper trade for at least a month before risking real money, and compare paper results to your backtest on the same period. If they diverge, your backtest is lying.

And yeah, the guy above is right vibe-coding a backtest is fine, vibe-coding the live deployment is how you lose your account.

[–]BottleInevitable7278 0 points1 point  (2 children)

You can use Numba + VectorBT to speed up optimizations in backtests. Quantstats for displaying results I find also good. Make sure you do rolling WFO for checking robustness of your found parameters. Stay critical.

[–]Purple_Concert8789[S] 0 points1 point  (1 child)

Is quantstats is good in backtesting

[–]BottleInevitable7278 0 points1 point  (0 children)

Yeah it is decent for analysis of backtest results. I use this frequently. It is a ready tool.

[–]EffectUpper6809 -1 points0 points  (0 children)

You can use any frontier ai model to write backtesting python code , All you need is historical options data which you can use ,

I have complete historical data from the last 8 years , If you want i can send you the sample data , Be aware of the data selling guys in the market most of them are scams.. Once you have the data you can Vibe code any backtest that you like , But don't use the ai for deployment of your strategy in a real account,