Ready to go further
Next: test without fooling yourself
The backtesting guide covers costs, untouched data and the ways a report can look better than the rule really is.
What is included
- What it is, in plain words
- The formula or mechanism, with exact arithmetic
- How it hits grid, martingale and DCA bots
- A check you can run before you switch a bot on
Who it is for
- People who run or plan to run a trading bot
- Anyone reading a backtest or a bot sales page
- Readers who want the numbers, not the pitch
- Not advice, and not a signal service
Key facts
- A strategy tester is the report a charting site builds after it replays your rules on the history it holds. It lists pretend trades and totals them. Names and layout change, so use the site's current documentation for where things are.
- Net profit alone is a poor summary. Read it beside the largest fall from a peak (maximum drawdown) and the number of trades.
- Commission, slippage and spread are inputs you set. If they are left at defaults, the profit may be the profit of a market with no costs.
- In our made-up report, 14 trades show a profit of $1,200. After a made-up $6 cost a trade it is $1,116, and without the single best trade it is $622.
- A report is a summary of one stretch of history under stated assumptions. It cannot show how a real order would have filled. This is education, not advice.
What the tester is doing
A strategy script holds rules: enter here, exit there. The tester replays the chart's history from the first bar to the last. Whenever a rule fires, it records a pretend order, fills it at a price it chooses by its own rules, and keeps a running tally. At the end it prints the list of trades and a summary. Everything in the report comes from that one replay.
That is useful and it is limited. The report cannot be better than the data it replays, the fill rules it uses and the inputs you gave it. If you want the language side of this, see Pine Script.
The numbers to read, in order
- Net profit against maximum drawdown. Net profit is the end total. Drawdown is the largest fall from a peak in the account during the test. A profit that needed a very large fall on the way is hard to live through. See max drawdown and drawdown.
- Number of trades. A report with few trades is mostly luck and one or two events. There is no single right count, but more independent trades give a steadier picture. See expectancy.
- Average trade and the spread of trades. Is the profit spread across many trades, or does one large win hold up the whole total? Remove the best trade in your head and look again.
- Win rate with the average win and loss. A high win rate says little alone. A rule can win often and still lose money if its losses are larger. See profit factor.
- Time in the market and the time covered. A test over a short, calm stretch says nothing about a different kind of market.
Inputs you set yourself
The tester has settings for starting capital, order size, commission, slippage and sometimes more. Treat them as part of the strategy. The values, units and defaults differ between versions and between instruments, so look at what your report actually uses rather than assuming.
- Commission. What the broker charges per trade, per unit or as a percentage. Check your own broker.
- Slippage. How far the fill is from the price the rule wanted. A small fixed amount per trade is a rough stand-in. Real slippage varies with speed and size. See slippage.
- Spread. The gap between buy and sell prices. Chart data is often one price series, so the spread must be added in some way. See spread.
- Order size. Larger size changes both profit and the worst fall. A report at one size does not scale in a straight line to a different size.
The bar magnifier idea
A bar shows only an open, a high, a low and a close. If a bar touches both your stop and your target, the report cannot know which came first from the bar alone. Some testers offer a way to look inside a bar using smaller time frames, so the order of events is better guessed. This is the general idea. It helps, but it is still a replay of recorded data. It is not a record of what your broker would have done, and the feature's name, limits and availability change over time.
A worked example with made-up numbers
Take a made-up report with 14 trades: 9 wins that total $2,100, 5 losses that total $900, a best single win of $500 and a maximum drawdown of $900. Now add a made-up cost of $6 a trade for commission, spread and slippage together. The figures below were calculated by us on 29 Oct 2026 and are made up.
| Reading | Calculation | Result |
|---|---|---|
| Reported net profit | $2,100 wins minus $900 losses | $1,200 |
| Costs | 14 trades at $6 | $84 |
| Net profit after costs | $1,200 minus $84 | $1,116 |
| Net profit against drawdown | $1,116 over $900 | 1.24 to 1 |
| Win rate | 9 of 14 | 64.3% |
| Average trade after costs | $1,116 over 14 trades | $79.71 |
| Without the best trade, after costs | ($1,200 minus $500) minus 13 times $6 | $622 |
One trade, the best, is $500 of the $1,200 reported. Remove it and the profit falls by about 42 percent before costs and about 44 percent after them, from $1,116 to $622. A report that depends on one trade is a story about one trade. With only 14 trades, a win rate of 64.3 percent could easily be 50 percent or 80 percent on the next 14.
What the strategy tester cannot show
- Real fills. It does not know the queue, the depth of the market or how your broker handles orders. See requotes.
- The future. It describes the past under assumptions. A rule fitted to that past will often fail on new data. See overfitting.
- Your limits. It does not know your account rules, margin or a daily loss limit. See daily drawdown rules.
- Your nerves. Living through a $900 fall is different from seeing it as a number in a table.
The next steps after a report are not more tuning. They are testing on data the rule has not seen, then a demo account. See forward testing and backtesting.
Keep Going
Related Tools and Guides
Keep exploring
FAQ
Frequently Asked Questions
What is the TradingView strategy tester?
It is the report a charting site builds after replaying a strategy script on its chart history. It lists pretend trades and totals them. The layout and names change over time.
Which numbers matter most in a strategy report?
Read net profit beside maximum drawdown and the number of trades. Then check how much of the profit comes from the best few trades, and whether costs were set honestly.
Should I trust a report with few trades?
Be careful. With a small count, one or two trades can decide the result, and the win rate can move a lot on the next handful. More independent trades give a steadier picture.
What commission and slippage should I enter?
Use values that match the broker and market you would really use, and check them with that broker. Defaults on a chart may not match. Try larger costs too, to see how fragile the result is.
What is the bar magnifier?
It is the general idea of looking inside a bar at smaller time frames to guess which of the high or low came first. It improves a replay but does not make it a record of real fills. Features and names change.
Are the numbers on this page real?
Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.
Can I use this to decide whether to run a bot?
It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.
Is this financial advice?
No. It is general education. The numbers are made up, and it does not consider your situation.
Know the Risk Before You Run It
Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.
Trading carries a risk of loss