Displaying Strategy Backtest Performance Metrics on a Chart
Summary
This TradingView script adds an on-chart table of common strategy backtest statistics, designed to be copied into an existing strategy. It displays trade count, win rate, starting and ending capital, average winning and losing trade amounts, profit factor, maximum runup, percentage return, and maximum drawdown. The example includes a basic mean-reversion strategy to demonstrate the panel, but the central contribution is the display logic rather than the example trading rules.
The metrics are drawn from the platform’s built-in strategy results and shown on the last confirmed historical bar. The document provides no backtest findings or evidence that the example strategy is profitable. The panel is a reporting convenience, and the displayed figures remain dependent on the strategy’s assumptions, instrument, costs, and test period. Users should also check how metrics behave when there are no closed trades or no winning or losing trades, since the shown calculations divide by those counts.
Key ideas
- The panel summarizes built-in strategy backtest results in a chart table.
- It displays trade count, win rate, capital, average win and loss, profit factor, runup, return, and drawdown.
- The displayed statistics are separate from the example strategy’s moving-average entry and timed exits.
- The document offers a reporting utility, not evidence of strategy performance.
- Metric interpretation depends on backtest assumptions and on the availability of trade outcomes.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.