algobacktesting

Your files stay on this device.

Example file
probability it's real
–
net result
–
trades to prove it
–

Your trades

How many setups did you try? (including this one)

Count every variation you tested, including dropped ones. This corrects for selection bias.

Saved in this browser only, never uploaded. Compare them under Compare.

Verdict

Waiting for trades
Probability the edge is real–
Trades needed to prove it–

Your profit against no edge

The numbers

Would this strategy pass an evaluation?

Resamples your trades through 5,000 evaluations. Set the rules to match your firm's.

If your file has trade dates, trades per day fills itself in.

A trailing limit never rises above your starting balance. Amounts are in the same money as your trades.

Probability of passing–
Probability of failing–
Median days to pass–

Once trades are loaded in the check, your pass probability shows up here.

When does your strategy actually work?

Results by entry hour or weekday, each corrected for every slice examined.

Results by time

Add a trade file with times in the check above, and your best and worst hours show up here.

Probability it's real: that the result reflects a repeatable pattern, not random variation. 95% or more is strong evidence. "Too few trades" means under 5.

Which setup is really better?

Two saved strategies, or two groups from your file, such as long against short.

Side by side

Add a trade file in the check above, and you can compare the strategies in it here.

At least 20 trades a side, with no trades in common. Comparing many pairs is a search too, so weigh a single standout with care.

Your saved strategies

    Nothing saved yet. Save a strategy under The check, then compare any two here.

    Stored in this browser only. Clearing this site's data removes them.

    Would a different stop have done better?

    Replays your entries on your own price bars at every stop size, and counts each size as a trial.

    1. Add your trades in the check above.
    2. Drop in one-minute bars for the same contract and dates.
    3. Your answer appears here. Everything else is set from your trades.
    Adjust the test (optional)

    Set from your own trades. Change them only to test something specific.

    Your bar file stays in your browser and is never uploaded.

    Add your trades above and a bar file here, and you'll see how different stops would have done.

    Exact fills, except a gapped stop fills at that bar's open. If one bar reaches both, the stop counts. No slippage.

    Describe a strategy. Test it on your bars.

    Write a rule and run it on your own bars. Every version you test counts as a trial.

    Your strategy

    No bars loaded

    Or start from an example: · · ·

    Price bars: use the or (one-minute bars work best; the stop lab uses the same file).

    Execution assumptions

    A signal is a bar's close; the trade enters at the next bar's open. A set time enters at that bar's open. One contract per trade.

    If one bar reaches both the stop and the target, the stop counts. A gapped stop fills at that bar's open.

    Sunday evening counts as Monday, so Monday's previous day is Friday. Times follow your bar file's clock. Anything you leave out gets a default, marked as assumed.

    The method, worked on the example

    The calculation, step by step, on the synthetic example (ORB, – setups tried).

    1. How big is the edge per trade?

      The example's – trades average – after fees, with a standard deviation of –. That is a Sharpe ratio of – per trade.

    2. What would no edge show?

      Try – setups with no edge and keep the best: its expected Sharpe ratio is – per trade from selection alone (Bailey and López de Prado, 2014, equation 2). Here that is – a trade.

    3. How sure can you be?

      The Deflated Sharpe Ratio is the probability that the true edge beats that bar, given the number of trades, skew and fat tails. Here it is –.

    4. How much more proof would it take?

      With trades like these, the probability reaches 95% at about – trades. Fees are included, so a breakeven is a small loss.

    Bailey and López de Prado (2012, 2014). Assumes independent setups tested on a similar number of trades. On simulated traders with no edge, false positives were about 5% for one setup and about 1% or less for five or more.

    Getting your trades out of your platform

    All you need is the closed trades from one account; you can pick the strategy once they're here. Menus move around between versions, so if yours look different, try Export on the trades or history view.

    TradingView

    In the Strategy Tester, open List of trades and use the export button to download a CSV. Each trade has an entry and an exit row; the page counts each trade once, using its Net P&L, which already includes the commission set in the strategy's properties.

    TopstepX

    Open the Trades tab at the bottom of the platform (not Orders), choose the date range and click Export. If the file has separate fee columns, keep subtract fees on.

    Quantower

    Open the Trades panel, choose Export data from its menu, tick all columns, pick comma-separated and export. Fills that share a position ID are combined into one trade, using the Net P/L column. For the stop lab, export bars from the History exporter.

    NinjaTrader 8

    Control Center, New → Trade Performance, choose the account, strategy and dates, click Generate, open the Trades view, then right-click and Export. Check whether your Profit column already includes commission, and set subtract fees to match.

    thinkorswim (Schwab)

    Monitor → Account Statement, set the dates, then Export to File from the menu at the top right. Buys and sells in Account Trade History are paired into round trips, first in, first out. Commissions are not in that section, so results are before fees. The stop lab replays each round trip from the fill that opened it.

    What the numbers mean

    Quick answers to what traders ask most.

    What does "probability the edge is real" mean?

    It is the Deflated Sharpe Ratio: the probability that your true Sharpe ratio beats what the best of your setups would be expected to show with no edge at all. It accounts for how many trades you have, how much they swing, their skew and fat tails, and how many setups you tried. At 95% or more, chance is a poor explanation for your results. Below 50%, they are no better than the expected best of your setups with no edge. It describes the past; it can't promise the future.

    What is a "setup", and why does the number matter?

    A setup is any strategy, indicator or set of rules you tested. Try ten ideas and keep the best, and the best one usually looks good even if none of them works: that is selection bias. So the check asks what the best of your setups would have shown with no edge at all, and holds your result to that bar. Versions you tried and dropped count too. If this is the only idea you've ever tested, 1 is right.

    What is the dashed "no edge" line?

    What the best of your setups would be expected to have made by now if none of them had an edge. With one setup it sits at $0, because a strategy with no edge averages nothing. Each extra setup you tried raises it. Finishing above it is a good sign; the probability above says whether you are far enough ahead.

    Why are breakevens counted apart, and why do they cost money?

    A trade that was flat before fees still paid commission, so after fees it is a small loss. The page counts these trades apart from real wins and losses, shows your win rate with and without them, and shows what they cost you in total.

    Which time zone are the hours in?

    Your file's, exactly as written in it; the page can't tell which zone that is. TradingView exports in the time zone set on your chart (the clock at its bottom right). Most other platforms use the time zone set in the platform or on your computer.

    Why didn't my TradingView trades line up with my bars?

    Usually the two files cover different dates: load bars for the same months as your trades. Continuous contracts such as NQ1! are also adjusted at each contract roll, so their prices sit a fixed number of points away from real prices, and trades may be stamped one chart bar early. The stop lab finds and corrects both, and tells you what it changed.

    Is my data uploaded anywhere?

    No. Your files are read in your browser, and the page is locked so it can't send data to any other site. Saved strategies stay in your browser on that device, and a shared link holds only summary numbers, never your trades.

    Is this financial advice?

    No. It is statistics about past results. A real edge can stop working when the market changes, and fills in live trading can be worse than in a replay.

    The same checks, as a Python library

    The Deflated Sharpe Ratio, the Probability of Backtest Overfitting and purged cross-validation for backtests. Every worked example in the source papers reproduces, and this page is tested against the library.

    pip install algobacktesting

    Python 3.11 or later; NumPy installs with it. On PyPI.

    True to the researchEvery worked example in Bailey and López de Prado (2012, 2014) and Bailey et al. (2017) reproduces to the printed precision. Verification report
    Open source, testedAnyone can read and reuse the code (MIT licence). Over 300 automated tests run on every change, and they check this page's math against the Python library. Code on GitHub
    Your trades stay yoursYour files are read on your own device, and the page's security policy stops it sending data to any other site. How privacy works
    Free to useBuilt by Daniel Heidary as an open research project. No accounts, no ads, nothing for sale. It describes past results; it isn't advice.