# Strategy tester: how TradingView, MT5, NinjaTrader and Ethy test a strategy

A strategy tester plays your rules over past prices and hands you a report. Here is how the four built-in testers work, from their own docs, which numbers in the report matter, and how many trades it takes before any of them mean something.

- URL: https://www.ethyai.app/blog/strategy-tester
- Author: Ethy Team
- Published: November 17, 2026; updated: November 17, 2026
- Publisher: Ethy AI, https://www.ethyai.app/

**The short answer:** A strategy tester replays a trading rule on past prices and reports what it would have done: every trade, net profit, max drawdown, profit factor and more. TradingView’s runs Pine Script strategies, MetaTrader 5’s runs Expert Advisors, NinjaTrader’s Strategy Analyzer runs NinjaScript, and Ethy tests rules you describe in plain English.

## What is a strategy tester?

A strategy tester is the part of a trading platform that takes a set of rules, walks them bar by bar through past prices, fills the orders those rules would have sent, and writes up the result. You get a list of simulated trades, an equity curve and a page of statistics. Most testers can also keep running on new bars as they arrive, which is called forward testing.

When people search for a strategy tester they usually mean one of three things: TradingView’s Strategy Tester (its help center now calls the panel the Strategy Report), the Strategy Tester inside MetaTrader 5, or a phone app with the same name. If you try an app, check what it actually does. A tester replays your rules on price history; a trade journal only stores trades you type in by hand.

This guide is about the testers themselves: how each one fills orders, which settings change the answer, and how to read the report. For a wider comparison that includes Python libraries and QuantConnect, see [best backtesting software](https://www.ethyai.app/blog/best-backtesting-software). For the method, with one real backtest worked from start to finish, see [how to backtest a trading strategy](https://www.ethyai.app/blog/how-to-backtest-a-trading-strategy).

| Tester | Where the rule comes from | What it does well |
| --- | --- | --- |
| TradingView Strategy Tester | A Pine Script strategy: built in, from the community, or your own | Results sit under the chart you already use; finer intrabar fills on Premium and Ultimate |
| MetaTrader 5 Strategy Tester | An Expert Advisor, MetaTrader’s automated program | Several tick models, optimization on local, remote and cloud agents, a forward period |
| NinjaTrader Strategy Analyzer | A NinjaScript strategy, coded in C# or generated by its Strategy Builder | Walk-forward optimization, basket tests and Monte Carlo runs |
| Ethy | A rule you describe in plain English | Tests the exact rules that would run live, with a training window and a held-out test window |

Before you go live, size each trade from its stop with the [position size calculator](https://www.ethyai.app/blog/position-size-calculator).

## How does TradingView’s Strategy Tester work?

A TradingView strategy is a Pine Script program that places simulated orders. You add one from the Indicators menu (built-in ones sit under Technicals, then Strategies; others under Community), and, in the words of its [help center](https://www.tradingview.com/support/solutions/43000764138-tradingview-strategy-report-how-to-start/), “the Strategy Report opens automatically when you add any strategy.” One strategy runs on a chart at a time. The report has four parts: Metrics (the equity chart and key figures), Performance analysis, Trades analysis, and the List of trades.

### How it fills orders

TradingView’s broker emulator only knows each bar’s open, high, low and close, so it has to guess the path in between. Its [Pine Script docs](https://www.tradingview.com/pine-script-docs/concepts/strategies/) spell out the guess: if the open is closer to the high, it assumes price went open, high, low, close. When a bar touches both your stop and your target, that guess decides which one filled. Users with Premium and Ultimate plans can override it with lower-timeframe data. In July 2026 the old “Using bar magnifier” checkbox became a Bar detalization menu, according to the [Pine release notes](https://www.tradingview.com/pine-script-docs/release-notes/), and the [bar magnifier article](https://www.tradingview.com/support/solutions/43000669285-what-is-bar-magnifier-backtesting-mode/) notes that a strategy can request at most 200,000 bars of that lower-timeframe data.

History is the other limit. With the default testing range the report keeps individual data for the latest 9,000 trades. [Deep Backtesting](https://www.tradingview.com/support/solutions/43000666265-how-deep-backtesting-works/) tests “all available historical data” for a symbol, up to two million bars and one million trades, on Premium and higher plans, and shows its results only in the report, not on the chart.

### The properties that change the answer

| Property | Default | Why it matters |
| --- | --- | --- |
| Initial capital | 1,000,000, in the symbol’s currency | Set your real account size, or dollar figures in the report mean little |
| Order size | A fixed quantity, a cash amount or a percent of equity | A percent of equity compounds; a fixed size does not |
| Pyramiding | How many entries in the same direction | Each extra entry adds risk the headline numbers can hide |
| Commission | None unless you set one | A strategy that trades often looks far better with no costs |
| Slippage | 0 ticks | Added to market and stop fills; set at least the spread |
| Long and Short leverage | Replaced the margin inputs in July 2026 | Decides when the simulation forces a margin call |
| Recalculate on every tick | Off | TradingView warns that “strategies using this option will repaint” |

Defaults are from TradingView’s [strategy properties](https://www.tradingview.com/support/solutions/43000628599-strategy-properties/) page and the Pine docs, which say that “if not specified, the strategy applies no commission to filled orders.” If you would rather have an AI assistant write the Pine Script, see [Pine Script with AI](https://www.ethyai.app/blog/pine-script-ai); to trade a TradingView idea with simulated money instead, see [how to paper trade on TradingView](https://www.ethyai.app/blog/how-to-paper-trade-on-tradingview).

## How does the MetaTrader 5 Strategy Tester work?

MetaTrader 5 tests Expert Advisors, the automated programs that trade inside the platform. Its [help pages](https://www.metatrader5.com/en/terminal/help/algotrading/testing) describe a test as “its single run with fixed parameters using historical price data,” and you start one by choosing Test in the context menu of an Expert Advisor in the Navigator window. It can also run custom indicators in visual mode, and test strategies that trade several symbols at once.

### Tick models

The biggest choice is how the tester builds price movement inside each bar. The [tick generation page](https://www.metatrader5.com/en/terminal/help/algotrading/tick_generation) lists the modes:

| Mode | What it uses | Trade-off |
| --- | --- | --- |
| Every tick | Generated OHLC and intermediate ticks | The most accurate generated mode, and the slowest |
| Every tick based on real ticks | Ticks recorded by the broker | The help calls it “as close to real conditions as possible” |
| 1 minute OHLC | Only the four prices of each 1-minute bar | Faster, with less detail inside the minute |
| Open prices only | Only each bar’s open on the testing timeframe | The fastest; stops and pending orders may trigger at a price other than the one set, especially on higher timeframes |
| Math calculations | No price history at all | For computations, not for trading rules |

You can also add execution delay: none, a fixed delay (for example your measured ping to the trade server), or a random one, which the help defines as a 90% chance of 0 to 8 seconds and a 10% chance of 9 to 18.

### Optimization and forward testing

The [optimizer](https://www.metatrader5.com/en/terminal/help/algotrading/optimization_types) runs the same Expert Advisor many times with different inputs. The slow complete algorithm tries every combination. The fast genetic algorithm searches with an evolutionary method and is, in MetaQuotes’ words, “much faster than the first one and is almost of the same quality.” A third mode runs the same inputs on every symbol selected in Market Watch, a quick way to see whether a setting only works on one market. The genetic search ranks passes by a criterion you pick: maximum balance, profit factor, expected payoff, recovery factor or Sharpe ratio, minimum drawdown, a custom value or a complex criterion. You can set aside a forward period of 1/2, 1/3, 1/4 or a custom split, and MetaTrader always uses the later part of the history for it. Runs can spread across local agents, remote agents and the MQL5 Cloud Network.

The [test report](https://www.metatrader5.com/en/terminal/help/algotrading/testing_report) also prints a History quality figure, “a percentage ratio of correct and incorrect one-minute data.” Look at it before anything else: a test on patchy data is a test of the gaps.

## What does NinjaTrader’s Strategy Analyzer do?

NinjaTrader calls its tester the Strategy Analyzer. Its [help guide](https://static.ninjatrader.com/support/helpGuides/nt8/strategy_analyzer.htm) says it “lets you run historical analysis on your NinjaScript automated trading strategies,” and you open it from New in the Control Center. NinjaScript is C#, but the [developer docs](https://docs.ninjatrader.com/ninjascript) add that “the Strategy Builder and wizards generate NinjaScript for you” if you would rather not write code.

- **Test types.** A plain backtest, optimization, walk forward optimization, multi-objective optimization and basket testing across several instruments.
- **Walk forward.** You set an optimization period and a test period, both in days, and the [guide](https://static.ninjatrader.com/support/helpGuides/nt8/walk_forward_optimize_a_strate.htm) is blunt about which one counts: “You evaluate strategy performance on the test data, not on the data you used for the optimization.”
- **Monte Carlo.** After a run you can resample its trades with replacement to see a range of outcomes. The [help page](https://static.ninjatrader.com/support/helpGuides/nt8/running_a_monte_carlo_simulati.htm) states the reason plainly: a backtest “can produce profitable results that may be due to luck alone.”
- **Fills.** In a backtest, NinjaTrader [determines fills from 4 data points](https://static.ninjatrader.com/support/helpGuides/nt8/discrepancies_real-time_vs_bac.htm), each bar’s open, high, low and close. The [Order Fill Resolution](https://static.ninjatrader.com/support/helpGuides/nt8/understanding_historical_fill_.htm) setting is Standard by default; High fills orders on a finer secondary series, such as a daily strategy filled on minute bars. Slippage is set in ticks and applies to market, stop-market and market-if-touched orders.

The [NinjaTrader homepage](https://ninjatrader.com/), which served us its EU edition, says the platform is “always free to use for advanced charting, backtesting and trade simulation.” Its focus is futures.

## How does Ethy test a strategy?

Ethy works the other way round: you start with words, not code. Describe the idea in plain English, and Ethy shows you the rules it understood, backtests the exact spec that would deploy, lets you optimize it, then deploys it live or on paper in one tap.

- **Markets.** Every perp on Hyperliquid’s main exchange and on trade.xyz (stocks, indices and commodities), and spot tokens. Coins Ethy can’t trade can still be backtested as research.
- **Up to 10 assets in one run**, and a simulated account of a $5,000 balance with $1,000 of margin per position unless you give your own.
- **The report.** Return and CAGR next to buy and hold; trades, wins and losses, win rate, profit factor, average and largest win and loss, longest losing streak and average hold; max drawdown, Sharpe, Sortino and Calmar; results per asset, long against short, by month and by market regime at entry; the equity and drawdown curves; and how often each condition passed. Every entry and exit is marked on the chart.
- **An optimizer with a held-out window.** It sweeps the rule’s tunable settings (thresholds, indicator lengths, take profit and stop loss), never the position size, ranks candidates on a training window and checks each one on a held-out test window.
- **The same reading live.** Indicator conditions are checked when a bar closes, on the last closed candle, the same way the backtest reads them.

| Timeframe | Hyperliquid windows (days) | Spot windows (days) |
| --- | --- | --- |
| 5m | 15 | 15 |
| 15m | 30, 60, 90 | 30, 60, 90 |
| 1h | 30, 90, 180 | 30, 60, 90 |
| 4h | 90, 180, 365 | 30, 60, 90 |
| 1d | 180, 365 | 180, 365 |

The limits matter as much. Ethy tests Hyperliquid perps and spot tokens, so it can’t test a futures broker’s data. Alerts, scanners, research tasks, smart-money and AI-signal automations can’t be backtested; for those Ethy offers paper mode instead. And it presents every result as an estimate on past data. More on the tool itself in [Ethy’s backtesting page](https://www.ethyai.app/ai-backtesting).

> **Ask Ethy:** [Backtest buying ETH when the 4H RSI(14) closes under 30, exit above 55, over 365 days, then optimize it on a held-out window.](https://agents.ethyai.app/chat?landing=blog&post=strategy-tester&prompt=Backtest%20buying%20ETH%20when%20the%204H%20RSI(14)%20closes%20under%2030%2C%20exit%20above%2055%2C%20over%20365%20days%2C%20then%20optimize%20it%20on%20a%20held-out%20window.)

## How do you read a strategy tester report?

Every tester prints dozens of figures. Five carry most of the weight, and each has a catch.

| Metric | What it is | What to check |
| --- | --- | --- |
| Net profit | The result of all trades; TradingView shows it in currency and percent | Compare it with buying and holding the same market over the same dates, not with zero |
| Max drawdown | The deepest fall from a peak in the equity curve | Ask whether you would really have held on; MT5 shows it on the balance and on equity, which includes open trades |
| Profit factor | Gross profit divided by gross loss ([TradingView](https://www.tradingview.com/support/solutions/43000681698-profit-factor/), [MT5](https://www.metatrader5.com/en/terminal/help/algotrading/testing_report)) | Above 1 means winners outweighed losers in this test; from a handful of trades it is noise |
| Number of trades | Closed trades, the ones that booked a profit or loss | The fewer there are, the more one trade decides everything else |
| Sharpe ratio | Return above a safe rate, divided by how much returns swing | Don’t compare it across tools: the inputs differ |

The Sharpe ratio is the clearest case of the same name hiding different math. TradingView’s [help](https://www.tradingview.com/support/solutions/43000681694-performance-summary-sharpe-ratio/) builds it from monthly returns and subtracts a 2% yearly rate by default. MetaTrader 5’s report assumes that rate is zero. So a strategy can show two different Sharpe ratios on two platforms without anything being wrong.

### How many trades are too few?

Here is a quick way to feel it. Suppose a rule truly wins half its trades. The win rate a test shows will land inside these ranges 95% of the time, from the standard binomial approximation:

| Closed trades | Win rate the test may show |
| --- | --- |
| 10 | 19% to 81% |
| 30 | 32% to 68% |
| 100 | 40% to 60% |
| 300 | 44% to 56% |

At 30 trades, a coin flip can look like a 68% winner or a 32% loser. At 100, the range is still 40% to 60%. Our rule of thumb: below 30 closed trades, read the report as a story, not as evidence; aim for 100 or more, spread over rising, falling and flat markets. Then count how many versions you tried, because the best of fifty variations is weaker evidence than one rule written down in advance. [Our backtesting guide](https://www.ethyai.app/blog/how-to-backtest-a-trading-strategy#mistakes) has the research behind that.

## What traps make a strategy tester look better than trading?

The tester is only as honest as its settings. These five traps show up in every platform above, and each docs page names its own version.

### Overfitting

An optimizer will always find a setting that fit the past. TradingView’s docs warn that an overfit strategy “often fails to perform well on new, unseen data,” and tell you to optimize on in-sample data, then “test the optimized configuration on the OOS data without additional fine-tuning.” MT5’s forward period, NinjaTrader’s walk forward and Ethy’s held-out window are all versions of that advice. Use them, and look at the result once.

### Look-ahead

A rule must only use what it could have known at the moment it acts. TradingView notes that recalculating after an order fills “can cause lookahead bias on historical bars.” The simple defense: decide on a closed bar and act on the next one.

### Repainting

Some settings make a strategy behave one way on history and another way live. TradingView says strategies that recalculate on every tick “will repaint,” and the setting doesn’t touch historical bars at all. NinjaTrader warns that running “On each tick” can change results, because a signal can be true in the middle of a bar and false at its close. Chart types that rewrite prices, such as Heikin Ashi and Renko, distort fills on both platforms.

### Guesses inside the bar

All three platforms see bars, not ticks, unless you pay or ask for more detail. TradingView guesses the path from open, high, low and close; NinjaTrader fills from those four points; MT5’s open-prices mode can fill stops at prices you never set. A strategy with tight stops and targets is the most exposed. Test it with finer data before you trust it.

### No slippage, no costs

TradingView starts with no commission and zero slippage, and its docs say that without modeling costs “traders may overestimate a strategy’s historical profitability.” Set commission, spread and slippage before you read the first number, and expect a live fill to be a little worse than a simulated one.

> **A tester measures the past** It shows how fixed rules would have behaved on prices that already happened, under the settings you chose. It does not tell you what the next trade will do.

## How can you start testing strategies for free?

All four testers have a free way in. TradingView has a free plan, and its report opens whenever you add a strategy to a chart; the deeper modes, Deep Backtesting and finer bar detail, are on Premium and higher. MetaTrader 5 is a [free download](https://www.metatrader5.com/en/download), though you need an Expert Advisor to test. NinjaTrader says backtesting is free. Ethy’s Free plan runs backtests on the shortest window of each timeframe, 180 days on the daily, and asks for no card.

Whichever you pick, run your first test like this:

1. **Write the rule in one sentence.** Market, timeframe, entry, exit, stop and size, with nothing left to judgment. “Buy BTC on the daily when it closes above its 20-day high, exit on a close below the 10-day low, risk 1% a trade.”
2. **Check the costs before you run.** Find out what commission, spread and slippage the tester assumes, and set them where it lets you, so the first result you see is closer to a realistic one.
3. **Read four numbers next to buy and hold.** Net profit, max drawdown, profit factor and the number of trades. If the trade count is under 30, stop and add history or markets.
4. **Keep the latest stretch aside.** Tune on the older data if you must, then run the final version once on the part you kept back.
5. **Forward test on paper.** Let it run on live prices with no money for a few weeks. Our guide to [paper trading](https://www.ethyai.app/blog/paper-trading) explains what that can and can’t show.

**Test a rule in plain English** Describe it the way you would to a friend. Ethy shows the rules, backtests them over up to 365 days, and checks the tuned version on a window it never saw. [Start free](https://agents.ethyai.app/?landing=blog&post=strategy-tester)

## Summary

- A strategy tester replays fixed rules on past prices and reports every simulated trade, the equity curve and statistics such as net profit, max drawdown and profit factor.
- TradingView tests Pine Script strategies and guesses each bar’s path from its open, high, low and close; Premium and Ultimate can use finer data, and Deep Backtesting covers all history.
- MetaTrader 5 tests Expert Advisors with five tick models, a genetic optimizer and a forward period; NinjaTrader’s Strategy Analyzer adds walk forward optimization and Monte Carlo runs.
- Ethy tests rules you describe in plain English on Hyperliquid perps and spot tokens, up to 365 days, and checks optimized settings on a held-out window.
- Trade count decides how much a report means: a rule that truly wins half its trades can show anywhere from 32% to 68% over 30 trades.
- Overfitting, look-ahead, repainting, intrabar guesses and missing costs make testers look better than trading. Set costs first and test once on data you kept aside.

## Questions people ask

### Is TradingView’s Strategy Tester free?

TradingView has a free plan, and the strategy report opens whenever you add a strategy to a chart. The deeper modes are paid: Deep Backtesting is for Premium and higher, and finer intrabar fills for Premium and Ultimate. Plan tables change, so check TradingView’s comparison page for which report metrics your plan shows.

### How do I open the Strategy Tester in MetaTrader 5?

In the Navigator window, right-click the Expert Advisor you want to test and choose Test. Then pick the symbol, the period, the tick model and any delay, and start the run. The Result tab then shows the profit, the number of trades, and statistics and charts for judging risk.

### What is a good profit factor in a backtest?

There is no single number. A profit factor above 1 means gross profits beat gross losses in that test. What makes it believable is everything around it: enough trades, realistic costs and slippage, and a similar result on data the rule was not tuned on. A high profit factor from a dozen trades says very little.

### How many trades does a backtest need?

As a rule of thumb, treat fewer than 30 closed trades as an anecdote and aim for 100 or more across different market conditions. Even at 100 trades, a rule that truly wins half the time can show anywhere from 40% to 60% by chance.

### Why do the TradingView and MT5 testers give different results for the same idea?

They fill orders differently and build the bar’s path differently, their default costs differ, and even the Sharpe ratio uses different inputs: TradingView subtracts a 2% yearly rate from monthly returns, MT5 subtracts nothing. Data from two brokers or exchanges also differs. Line up the settings before comparing.

### Can Ethy test a TradingView strategy?

Not directly: Ethy does not import Pine Script. You can describe the same rule in plain English, and Ethy builds and backtests its own version on its markets, Hyperliquid perps and spot tokens, then shows you the rules it used so you can compare them with your script.

## Sources

- [TradingView Help Center: Strategy properties](https://www.tradingview.com/support/solutions/43000628599-strategy-properties/)
- [TradingView Pine Script docs: Strategies (broker emulator, bar detail, commission and slippage, repainting, out-of-sample testing)](https://www.tradingview.com/pine-script-docs/concepts/strategies/)
- [TradingView Pine Script release notes (July 2026: Bar detalization, Order execution delay, leverage inputs)](https://www.tradingview.com/pine-script-docs/release-notes/)
- [TradingView Help Center: How Deep Backtesting works](https://www.tradingview.com/support/solutions/43000666265-how-deep-backtesting-works/)
- [TradingView Help Center: What is bar magnifier backtesting mode](https://www.tradingview.com/support/solutions/43000669285-what-is-bar-magnifier-backtesting-mode/)
- [TradingView Help Center: TradingView Strategy Report, how to start](https://www.tradingview.com/support/solutions/43000764138-tradingview-strategy-report-how-to-start/)
- [TradingView Help Center: Sharpe ratio](https://www.tradingview.com/support/solutions/43000681694-performance-summary-sharpe-ratio/)
- [TradingView Help Center: Profit factor](https://www.tradingview.com/support/solutions/43000681698-profit-factor/)
- [MetaTrader 5 Help: Testing trading strategies](https://www.metatrader5.com/en/terminal/help/algotrading/testing)
- [MetaTrader 5 Help: Tick generation modes](https://www.metatrader5.com/en/terminal/help/algotrading/tick_generation)
- [MetaTrader 5 Help: Optimization types](https://www.metatrader5.com/en/terminal/help/algotrading/optimization_types)
- [MetaTrader 5 Help: Testing report](https://www.metatrader5.com/en/terminal/help/algotrading/testing_report)
- [MetaTrader 5: download](https://www.metatrader5.com/en/download)
- [NinjaTrader 8 Help Guide: Strategy Analyzer](https://static.ninjatrader.com/support/helpGuides/nt8/strategy_analyzer.htm)
- [NinjaTrader 8 Help Guide: Walk Forward Optimization](https://static.ninjatrader.com/support/helpGuides/nt8/walk_forward_optimize_a_strate.htm)
- [NinjaTrader 8 Help Guide: Running a Monte Carlo Simulation](https://static.ninjatrader.com/support/helpGuides/nt8/running_a_monte_carlo_simulati.htm)
- [NinjaTrader 8 Help Guide: Understanding historical fill processing](https://static.ninjatrader.com/support/helpGuides/nt8/understanding_historical_fill_.htm)
- [NinjaTrader 8 Help Guide: Discrepancies, real-time vs backtest](https://static.ninjatrader.com/support/helpGuides/nt8/discrepancies_real-time_vs_bac.htm)
- [NinjaTrader Developer Docs: NinjaScript](https://docs.ninjatrader.com/ninjascript)
- [NinjaTrader: homepage (free charting, backtesting and simulation)](https://ninjatrader.com/)
