TRADING PLATFORMS · STRATEGY TESTING
Backtesting applies a fixed set of trading rules to historical data and records the trades those rules would have produced. A useful result includes the data period, order assumptions, position size and trading costs. The final profit number cannot explain those choices on its own.
A setup can look convincing on a chart you have already seen. The harder question is whether you could have identified it using only the information available at the time. This guide takes that question through a repeatable test, a current TradingView workflow and a small hypothetical futures ledger. The ledger explains the arithmetic; it is not a historical strategy result.
Choose what your backtest needs to test
Manual replay and automated testing answer related questions. Manual replay lets you make decisions as historical bars unfold. It suits discretionary rules that involve interpreting structure, context or the appearance of a retest. An automated strategy applies coded conditions consistently across its dataset, which makes it easier to inspect many observations and repeat the same calculation.
| Method | What you do | What to inspect |
|---|---|---|
| Manual historical replay | Reveal history gradually and record each qualifying decision | Future information, skipped trades and consistent interpretation |
| Automated historical strategy | Run explicit entry, exit and sizing rules through an emulator | Code, available data, order timing and fill assumptions |
| Forward simulation | Apply the frozen version as new market data arrives | Signal timing, missed decisions, execution differences and rule adherence |
A chart indicator is not automatically an automated strategy. It may draw a line or arrow without specifying an executable entry, exit or quantity. The TradingView indicators guide helps separate a tool's visual output from the decision it is supposed to support.
No-code and AI-assisted tools still need explicit rules. If a description says “buy a strong breakout,” inspect what the generated system treats as strong, when it recognizes the breakout and which price it uses. A polished report does not establish that the system tested your intended idea. Review individual trades against the written definition.
Historical testing is also different from scenario analysis. A historical backtest follows an actual dataset through a stated model. A scenario test asks what happens under constructed conditions. Both can be useful, but a synthetic price sequence or shuffled trade ledger should retain that label when you discuss its result.
Write the rules before opening the test period
Start with an observable question. “Does this setup work?” leaves too much undecided. A testable version names the instrument, timeframe, trading session, entry event, order type, exit rule and size. It also explains when a possible setup becomes invalid and whether another attempt is allowed.
For example, suppose you want to study a close above a previously defined range. Specify how the range is formed, which bar must close outside it and when the range becomes available. Then decide whether entry occurs at the next available price or waits for a limit retest. Those versions can produce different trades even when the chart annotation looks identical.
Write the stop and target rules just as carefully. A stop below the signal bar, a fixed eight-point stop and a volatility-based stop are separate tests. Decide how to handle an entry that never fills, a gap through the stop, a session-ending exit and simultaneous conditions. Record these decisions before the outcome can influence your preference.
Give the version a name and keep a dated copy. Save the inputs, session clock, data source and any exclusions. If you change the rule midway through the work, preserve the original result and start a new version. Otherwise, the finished ledger may combine trades that no single rule set would have generated.
Discretionary testing needs the same discipline. Keep an image of the setup as it appeared at decision time, along with the reason it qualified. Include the trades you declined and why. This makes a later review more useful than a folder containing only the cleanest winners.
Choose data that can answer the question
Select the date range before inspecting its performance. Include the market conditions relevant to the intended use: quieter sessions, directional moves, ranges and volatile periods. A result from one favorable environment describes that environment. It cannot establish that the same behavior survives a different one.
More rows do not repair unsuitable data. Check missing bars, timestamps, session boundaries, price adjustments and the history actually available at the selected resolution. If you test a stock universe, the selection process should account for securities that disappeared during the period. Testing only today's survivors can change the question without making that change obvious.
For futures, distinguish a continuous chart from a particular contract month. Continuous history can be convenient for developing an idea, but roll construction and price adjustments affect historical levels. Keep the symbol, adjustment choice and session settings with the result. Investigate roll-related trades before treating their price changes as an ordinary executable move.
Also distinguish a requested start date from the first usable bar or trade. Indicators may need a warm-up period, signals may occur infrequently and the platform may not have the history you expected. Read the actual range and first entries in the report. Selecting an earlier date does not manufacture missing historical bars.
TradingView's historical capacity and advanced testing features depend on the plan, instrument and timeframe. Use the TradingView pricing and data guide when deciding whether an entitlement addresses your particular limit. A larger subscription is useful only when it provides data or a feature your test requires.
Run a built-in strategy in TradingView
The desktop example uses standard candles on CME_MINI:MNQ1!, the Micro E-mini Nasdaq-100 continuous contract, at five minutes. It demonstrates the interface with an existing strategy. The chosen strategy, dates and default lengths are not a recommendation or a search for the most profitable settings.
Open Indicators, metrics, and strategies. Under Technicals, select Strategies, or search for Two moving averages crossover. Add the built-in result. Its chart legend appears as 2MA cross, and TradingView opens the strategy report panel below the chart.

Double-click the strategy name on the chart to open its settings. In Inputs, the demonstrated version shows FastLength 9 and SlowLength 18. These lengths count chart bars, so a five-minute chart and a daily chart apply them to different periods. Keep the timeframe with the input values when saving a test.

In Properties, set Default order size to 1 and its unit to Quantity for a fixed one-contract demonstration. The example uses $100,000 of virtual initial capital and 1x leverage to let the emulator fund the position. That is a testing configuration, not a prop firm's available loss allowance or an amount the reader needs to deposit.
The quantity setting describes the new position size. This built-in strategy can reverse between long and short. A reversal transaction can therefore trade two contracts: one to close the existing position and one to open the opposite position. An arrow marked two does not necessarily mean the new position holds two contracts. Inspect the resulting position and the units charged at each fill.
Set the hypothetical Commission to 1, with Per contract as the unit. Scroll within Properties to Slippage and enter 1 tick. This assumes $1 per contract on each filled side and one adverse tick on each affected fill. Replace those assumptions with the costs and order behavior relevant to your test.

The demonstrated execution settings are On bar close, One tick order execution delay and Default (4 ticks per bar) bar detalization. Keep them in the test record. A strategy's calculation time and its earliest simulated fill time are separate events; an order generated after a close does not automatically receive that same closing price.
Press Ok, open the strategy report and inspect its trades. A report with no trades needs diagnosis: verify that signals exist in the available range, the order size is valid and the virtual capital can support it. Increasing capital to make an order possible changes the test configuration; it does not improve the strategy's signal.
Inspect a trade before reading the headline performance
In the report, use the table icon for List of trades and the chart icon for Metrics. Open a completed trade and compare its entry time, exit time, side, quantity, prices and fees with the rule definition. An open position should remain distinguishable from a completed trade.
The Download .csv control exports the trade list. Keep that file beside the settings and test version. Preserve enough context to repeat the run: symbol, timeframe, session, date range, input lengths, sizing, costs and execution settings. A CSV containing trade outcomes alone does not explain how the emulator produced them.

The displayed report changes as the dataset and current bar change. Exporting a result gives you a dated record, rather than an expectation that the screen will remain identical forever. For manual testing and review, the prop firm trading journal provides fields for the original plan, realized result and whether you followed the rule.
Keep historical simulation, forward simulation and actual trading in separate groups. Tag the strategy version and data period before comparing them. If a difference appears, investigate fills, costs, missed signals, market conditions and rule changes. A single “performance” column hides too many possible explanations.
A small trading cost can change the sign of a result
Consider six entirely hypothetical one-contract MNQ trades. Their price changes before costs are +10, −8, +12, −8, +6 and −8 points. MNQ's contract multiplier is $2 per index point, and its outright tick is 0.25 points, worth $0.50. These specifications are published by CME.
Assume $2 of commission per round trip and one adverse tick on entry plus one on exit, costing another $1 per completed trade. The combined $3 deduction is an illustration, not a broker quote. Here the starting price changes exclude both costs, so each is deducted once.
| Trade | Price change | Before costs | Assumed costs | After costs |
|---|---|---|---|---|
| 1 | +10 points | +$20 | $3 | +$17 |
| 2 | −8 points | −$16 | $3 | −$19 |
| 3 | +12 points | +$24 | $3 | +$21 |
| 4 | −8 points | −$16 | $3 | −$19 |
| 5 | +6 points | +$12 | $3 | +$9 |
| 6 | −8 points | −$16 | $3 | −$19 |
| Total | +4 points | +$8 | $18 | −$10 |
There are still three winners and three losers after costs. The 50% win rate did not change, yet the total changed from +$8 to −$10. The average before costs was about +$1.33 per trade; after costs, it was about −$1.67. A win rate alone would miss the difference.
Profit factor changes too. Before costs, the winning trades total $56 and the losing trades total $48, giving 56 ÷ 48 ≈ 1.167. After the stated deductions, winning trades total $47 and losses total $57, giving 47 ÷ 57 ≈ 0.825. Neither ratio predicts the next trade.
If an exported price already includes simulated slippage, use that price in the result. If the report already deducts commission, keep that deduction rather than applying it again. State which convention the ledger uses. Double-counting can make a test look worse just as omitted costs can make it look better.
Read expectancy, drawdown and the assumptions behind them
Expectancy is the average outcome under the observations and cost convention you are analyzing. It can also be calculated as win rate multiplied by average win, minus loss rate multiplied by average loss, with a consistent treatment of breakeven trades. Check the realized averages rather than substituting a planned target.
R-multiples make results comparable to initial risk, but define the denominator. If the six-trade illustration uses an original eight-point risk of $16 for each trade, its net average is −$1.6667 ÷ $16 ≈ −0.1042R. This denominator excludes costs; actual stopped-out losses can exceed 1R under that convention. The risk reward ratio guide explains planned ratios versus realized outcomes.
A profit factor above one describes a positive total for the included profit and loss observations. It is not a universal approval threshold. Look at the number of trades, concentration in a few winners, date selection, costs and validation procedure. Changing any of those can matter more than the difference between two attractive-looking ratios.
Maximum drawdown describes a decline from a preceding equity peak, but reports do not all use the same observation detail. A closed-trade ledger measures changes after trades finish. An equity-based measure can include open-position movement between those points. Keep the definition with the number before comparing it to another report or a firm's loss rule.
The maximum drawdown formula and calculator works through a chronological equity curve where the largest percentage decline and the largest cash decline occur in different episodes. It includes running-peak Excel formulas and recovery calculations.
The six net outcomes have 120 distinct orderings because three outcomes are identical. With fixed one-contract size and additive dollar results, every ordering ends at −$10. Their closed-trade maximum drawdowns range from $19 to $57; the original ordering produces $29. Rearranging the same outcomes changes the path, not the total profit.
This explains a limit of simple trade-order shuffling. It can explore sensitivity to sequence under its assumptions. It cannot create new market conditions, prove that the original signals had an edge or establish a probability of future failure on its own. Compounding, changing position size, resampling with replacement or imposing a stopping rule would be different models.
Check what the fill model knows inside a candle
One bar can trade through both a stop and a target. Open, high, low and close do not reveal every intervening event. TradingView's default historical emulator infers a path from those prices. Its current documentation describes open → high → low → close when the open is closer to the high, and the opposite sequence when it is closer to the low.
The official strategy documentation also explains gaps, trading costs, limit verification and historical bar detail. Higher bar detail can use available lower-timeframe bars to refine the simulation. It still depends on data coverage and is not a reconstruction of every order-book event.
A limit price touched on a candle does not prove your live order would have filled. Queue position, incoming quantity and arrival time matter. The trading order types guide separates price eligibility, activation and actual execution. Keep those events distinct when interpreting a simulated retest entry.
Use standard candles for this workflow. Nonstandard charts such as Heikin Ashi and Renko can use calculated prices that differ from executable market prices. Also inspect higher-timeframe requests, unconfirmed bars and recalculation settings: a historical marker can look clean while using information unavailable at the decision time.
Reserve a test period that cannot choose its own rules
Separate development data from evaluation data chronologically. Develop and adjust the rules on the first part, then freeze the version before running the reserved period. The split should suit the strategy's frequency and market coverage; a particular percentage is a design choice, not a guarantee of reliable evidence.
If you inspect the reserved result, change the settings and test it again, that period has helped develop the strategy. Keep the record, but stop calling the revised result an untouched out-of-sample test. Record how many versions and parameter combinations you tried, including the disappointing ones.
Walk-forward testing repeats a predefined development-and-evaluation process through time. Each evaluation window must use decisions made from earlier information. State how often parameters can change, how long development lasts and whether evaluation windows overlap. Combining only the best windows afterward defeats the purpose.
Sample size has no magic trade count that proves an edge. Six trades are enough to explain our arithmetic, not enough to validate a strategy. More observations can help, but correlated entries during one market event may add less independent information than their count suggests. Uncertainty, market coverage and the number of attempted strategies also matter.
Forward simulation then tests the frozen rules as new data arrives. Record missed signals, hesitation, platform differences and deviations separately from the strategy's compliant trades. There is no fixed number of weeks or winning trades that automatically establishes readiness for larger financial exposure.
Fit the test to the rules of the account you may use
A profitable final balance does not establish that a prop firm evaluation would have survived the path. Daily loss limits, trailing thresholds, session deadlines, permitted instruments and position limits can affect a sequence before its eventual recovery. Compare the current plan's rules with the data detail your test retains.
A closed-trade ledger cannot prove compliance with an intraday equity threshold. It may omit a large unrealized loss that occurred before a profitable exit. Likewise, $50,000 or $100,000 shown as a nominal account size is not automatically the amount available to lose. Use the actual allowed loss room when evaluating the intended position size.
Preserve the complete result and choose the next test from the unresolved question: data coverage, fill assumptions, costs, a new period or execution consistency. That gives the next run a purpose. Repeatedly changing inputs until the headline turns green only changes which version you have selected.

Compare HDP discounts
Lucid 30% · Tradeify 30% · TPT 50%.
See current offers ↗Eligible partner plans only.
Backtesting FAQ
What is backtesting in trading?
Backtesting applies specified trading rules to historical data and records the simulated outcomes. Its interpretation depends on the data, timing, sizing, fill assumptions and costs used. It evaluates a historical model; it does not establish future profitability.
Can I backtest for free?
You can begin with a manually recorded historical review or available built-in platform tools. History depth, instruments, resolutions and advanced functions have separate limits. Check the feature you need rather than assuming every market and date range is included in a free plan.
What is the easiest way to start backtesting?
Choose one instrument, one timeframe and one clearly defined setup. Freeze the rules and dates, then record every qualifying trade and its assumptions. A short first batch can reveal recording mistakes; it is not a statistical certification of the strategy.
Is manual or automated backtesting better?
Manual review suits discretionary decisions and preserves their context. Automated testing repeats explicit rules efficiently. Both can contain bias or execution assumptions. Choose the method that represents the decision, then inspect individual trades.
Where is the strategy report in TradingView?
Add a strategy from Indicators, metrics, and strategies. Technicals → Strategies contains built-in choices, including Two moving averages crossover. The report opens below the chart; use its strategy-name control to reopen the panel when collapsed.
Why does my TradingView backtest show no trades?
Check whether the strategy generates signals in the available period, whether its size is valid and whether virtual capital supports the position. An indicator without strategy orders does not generate a trade report. Inspect the configuration before interpreting an empty result.
How do I include commission and slippage?
Open the strategy's Properties. Choose the Commission amount and unit, then set Slippage in ticks. The demonstration uses $1 Per contract per filled side and one tick of adverse slippage; these are hypothetical inputs. Replace them with appropriate assumptions.
Does a 50% win rate mean a strategy breaks even?
No. Average winning and losing amounts, costs and exit behavior determine the total. Our synthetic six-trade example has three winners and three losers, yet changes from +$8 before costs to −$10 after its assumed costs.
What is a good profit factor?
There is no universal approval level. A ratio above one means included profits exceed included losses under that calculation. Inspect costs, outliers, date selection, trade count and out-of-sample results before drawing a broader conclusion.
How many trades make a backtest reliable?
No fixed count proves reliability. Sample dependence, market coverage, strategy frequency, uncertainty and how many alternatives you tested all affect interpretation. A small batch can check the process, while validation needs evidence beyond a convenient minimum.
What is lookahead bias?
Lookahead bias occurs when a historical decision uses information that was unavailable at that time. Examples include future values leaking into a script or deciding an earlier entry after seeing a later close. Gradual replay does not automatically repair a leaking indicator.
What is out-of-sample testing?
It evaluates a frozen strategy on data not used to develop that version. Once a result influences a change, that inspected period has become part of development. Keep a new untouched evaluation period or a predefined walk-forward process for the revised version.
Can Monte Carlo trade shuffling prove an edge?
No. Shuffling a fixed set of additive dollar outcomes changes sequence and drawdown while preserving the total. It explores a particular model of path sensitivity; it does not generate new market evidence or prove future profitability.
Does a profitable backtest mean I would pass a prop firm?
No. Survival also depends on the firm's loss thresholds, timing, instruments and other rules throughout the path. A closed-trade result can omit intratrade equity violations. Check the current plan and the information your test actually measures.
