Contents

Charts

Strategy Tester

Backtest a Pine strategy against the chart's history.

The Strategy Tester sits in a panel under the chart. Strategy Tester on the right rail (Ctrl+Shift+E) shows or hides it, and adding a strategy opens it. For the strategy on the active chart it shows an equity curve, a performance summary (net profit, maximum drawdown, run-up, percent profitable, profit factor and more) and the list of trades with entry, exit, size and profit. With several strategies on the chart, choose which to show.

Things to know

  • The backtest covers only the bars the chart has loaded. Scroll the chart back to load more history and the tester updates.
  • Results are approximate. Orders are simulated slightly differently from TradingView, and equity, run-up and drawdown are measured on bar closes.
  • Margin calls. A strategy that orders 100% of its equity and also pays commission can be closed immediately by a margin call. The tester detects and explains this; reduce the order size to fix it.