Backtesting software: data, execution and workflow
Choose backtesting software by the trades it can model and the data you can verify. TradingView fits a Pine Script chart workflow; LEAN supports portfolio research in Python or C#; Backtrader gives Python users control of a local test. A larger simulated profit is not evidence that one engine is better.
Sources checked 2026-10-16. This comparison combines official documentation with one local Backtrader experiment. TradingView and LEAN were not run head to head. Pineify publishes this page and offers the related optimization and report products below.
Compare the workflowsCompare the engine before the report
These are three different research workflows, not a ranked list. Use the execution column to identify assumptions you must test. Read across the table on smaller screens.
| Software and workflow | Data | Execution | Limit to check | Cost boundary |
|---|---|---|---|---|
| TradingView Strategy Tester Pine Script strategies on a chart; useful when the strategy and review process already live in TradingView. Official execution documentation | Chart symbol, exchange feed and available history. Record the session, timeframe and chart type. | With default bar-close calculation, market orders fill on the next available tick. Historical fills use the broker emulator; Bar Magnifier can use lower-timeframe data. | Pine strategies place simulated orders on the chart asset, not a portfolio of different assets. Pine orders do not directly trade a Trading Panel broker or paper account. | Plan, history and data entitlements require checking. A charting subscription is not a promise of every exchange feed. |
| QuantConnect / LEAN Python or C# research with an engine that supports multiple asset classes and portfolio logic. Official execution documentation | Choose datasets and data resolution for the assets being modeled. Keep the data configuration with the code. | Fill models determine fill prices and quantities and work with slippage models. Review the selected asset and brokerage models before comparing results. | A configurable model still needs suitable data and assumptions. A multi-asset engine does not make daily bars adequate for queue-position research. | LEAN is open source. QuantConnect cloud plans, compute and dataset purchases have their own terms. |
| Backtrader A Python library for a locally controlled research process, with data feeds and broker settings managed in code. Official execution documentation | Provide the feed and verify its timestamps and adjustments. The experiment below uses an explicit synthetic CSV. | Ordinary market orders execute at the next bar open. The default backtesting broker does not constrain fills by traded volume; volume filling can be configured. | You own the environment, data checks and reporting. Cheat modes change timing assumptions and need explicit justification. | Open-source software under GPLv3. Data, infrastructure and engineering time remain separate costs. |
TradingView also provides risk and trade analysis in its strategy report. See the Strategy Tester report guide for metric definitions.
A reproducible test: when does a market order fill?
This local test ran on 2026-10-16 with Python 3.14.7 and Backtrader 1.9.78.123. All prices are hypothetical USD values, not historical quotes. Start with $10,000, buy 10 shares after the first bar, then submit a market exit after the second. Charge 0.1% of traded value on each side; use zero slippage, no leverage and no other costs.
| Date | Open | High | Low | Close |
|---|---|---|---|---|
| 2026-01-05 | 99 | 101 | 98 | 100 |
| 2026-01-06 | 103 | 105 | 102 | 104 |
| 2026-01-07 | 102 | 104 | 101 | 102 |
Measured: default next-open fills
Net P&L: -$12.05
Buy at $103, sell at $102. Gross P&L is -$10; commissions are $1.03 + $1.02. Ending equity is $9,987.95.
Measured: cheat-on-close enabled
Net P&L: +$37.96
Buy at $100, sell at $104. Gross P&L is $40; commissions are $1 + $1.04. Ending equity is $10,037.96.
The $50.01 difference comes from the fill setting, with identical signals and bars. The close-fill run is a timing sensitivity check: it does not establish that orders decided at the close could actually obtain that price. Backtrader describes the setting in its broker documentation.
Reproduce both Backtrader runs
Save the Python code as timing_test.py and run it in an isolated environment with the pinned package. Both ending-equity assertions must pass.
# Tested with Python 3.14.7 and backtrader==1.9.78.123
# Install in a separate environment: python -m pip install backtrader==1.9.78.123
import backtrader as bt
import csv
import tempfile
from pathlib import Path
rows = [
("2026-01-05", 99, 101, 98, 100, 1000),
("2026-01-06", 103, 105, 102, 104, 1000),
("2026-01-07", 102, 104, 101, 102, 1000),
]
class TimingTest(bt.Strategy):
def next(self):
if len(self) == 1:
self.buy(size=10)
elif len(self) == 2:
self.close()
def notify_order(self, order):
if order.status == order.Completed:
print(order.executed.price, order.executed.comm)
with tempfile.TemporaryDirectory() as directory:
file = Path(directory) / "fixture.csv"
with file.open("w") as stream:
writer = csv.writer(stream)
writer.writerow(["date", "open", "high", "low", "close", "volume"])
writer.writerows(rows)
for close_fill in (False, True):
engine = bt.Cerebro()
engine.adddata(bt.feeds.GenericCSVData(
dataname=str(file), dtformat="%Y-%m-%d", openinterest=-1))
engine.addstrategy(TimingTest)
engine.broker.setcash(10000)
engine.broker.setcommission(commission=0.001)
engine.broker.set_coc(close_fill)
engine.run()
equity = round(engine.broker.getvalue(), 2)
print(close_fill, equity)
assert equity == (10037.96 if close_fill else 9987.95)
What this says about TradingView and LEAN
TradingView documents next-tick fills under its default calculation settings, consistent with the timing of the first run. That is a documentation-based expectation, not a measured TradingView result. LEAN fills depend on the selected model and data, so no numeric LEAN result is claimed here. TradingView documentation reviewed: Pine Script v6. No TradingView service build or LEAN runtime version was tested.
Make a real-market comparison repeatable
- Freeze one strategy specification: signal observation time, order type, sizing, exits and warm-up. Start with one symbol and a few orders that you can reconcile manually.
- Record the full symbol and venue, data vendor, resolution, session, timezone, date range and adjustment settings. Check missing bars, stock splits and dividends. Portfolio tests also need a universe that includes delisted instruments.
- Keep the same fee schedule, spread assumption, slippage, starting cash and currency. Add borrow costs for shorts and funding where relevant; do not assume a commission field models all of them.
- Save the script hash, engine/package version or service test date, settings and exported order ledger. Compare order creation time, fill time, price, quantity and fees before comparing equity curves.
- For bars touching both stop and target, inspect lower-timeframe data or report the ambiguity. Use ordinary price bars for the baseline; synthetic chart prices can create fills that were unavailable in the market.
- Choose parameters on a training window, freeze them, then evaluate a later held-out window. Record all trials. A single profitable holdout is evidence to investigate, not a guarantee.
This protocol is a proposed research procedure. No matched real-market dataset, runtime-speed benchmark or cross-platform performance ranking was produced for this page.
Free backtesting software: check the full cost
Backtrader and LEAN make their engine source available under their respective licenses. Running an open-source engine locally is a different offer from subscribing to a hosted service. Budget separately for clean historical data, compute, storage and maintenance. A free daily dataset may be enough to test a daily signal but cannot establish a queue-sensitive intraday fill.
Check TradingView's plan table and QuantConnect's cloud plans for current history, report and resource entitlements. Dollar prices are omitted because billing period, location, data and compute choices affect the total.
If your strategy stays in TradingView
Pineify Strategy Optimizer tests input combinations in TradingView, lets you compare the resulting metrics and exports optimization results to CSV. It requires the Advanced plan or higher. Its results inherit the chart data and execution assumptions being tested. More combinations increase the need for a separate validation period.
Backtest Deep Report analyzes a supported trade CSV after the run. It cannot reconstruct missing intrabar prices or repair unrealistic source fills. Check CSV compatibility before upload; an XLSX export is not the same input format. Neither product is a multi-asset live trade execution engine.
Explore Strategy OptimizerBacktesting software FAQ
What is the best backtesting software?
The best backtesting software depends on the orders and data you need to model. TradingView suits a Pine Script chart workflow. LEAN is an option for Python or C# portfolio research. Backtrader suits a locally controlled Python process. Compare a small trade ledger with fixed assumptions before selecting a platform.
Can I use backtesting software free of charge?
Backtrader and the LEAN engine are open-source options. Hosted products also have plan-specific entry options, but free software does not include every dataset, exchange entitlement or compute resource. Check the current official plans and the license of the data you intend to use.
Why do two backtesting tools show different profits?
Differences can come from signal timing, fill prices, session boundaries, corporate-action adjustments, position sizing or costs. Reconcile individual entry and exit orders before comparing headline returns. Matching net profit alone can conceal offsetting errors.
Does TradingView only provide basic profit and loss metrics?
No. TradingView documents a strategy report with trade details, risk-adjusted ratios and drawdown analysis. Check which report features your plan includes. An external report is useful for a different analysis workflow, not because TradingView has no risk metrics.
Is Pineify a separate backtesting execution engine?
Pineify Strategy Optimizer tests parameter combinations in TradingView. Backtest Deep Report analyzes supported trade CSV files. These workflows do not replace the source fill model or provide a multi-asset live execution engine. Optimizing or analyzing a flawed backtest cannot fix its underlying data.
Does a better backtest guarantee a better live strategy?
No. Parameter selection can fit historical noise, and live costs or fills can differ. Freeze the selected rules before testing a held-out period, keep a record of every trial, and compare subsequent forward-test orders with the historical assumptions.
Sources and related reading
Official sources checked 2026-10-16. Product features and plans can change.
- TradingView: Pine Script v6 strategies and broker emulator
- TradingView: strategy and execution limits
- TradingView: current plans and feature availability
- QuantConnect: trade fill models
- LEAN: official engine repository and license
- QuantConnect: current cloud plans and resources
- Backtrader: order creation and execution
- Backtrader: broker settings, fees and cheat-on-close
- Backtrader: official repository and license
Educational software comparison, not investment advice. All experiment prices are synthetic. Backtests and forward simulations do not guarantee live fills or future returns.