Skip to content
All library documents

Pine Script Tables for Strategy Performance and Seasonal Analytics

Article TradingView scripts

Summary

This Pine Script library provides reusable structures and functions for displaying trading strategy statistics in chart tables. Its reported measures include trade counts, win and loss rates, streaks, average profits and gains, variability, position quantity, capital at risk, take-profit executions, risk-to-reward ratios, and hypothetical profit if the position had been fully exited at the last exit. It also includes metric and seasonal tables, with configurable position, dimensions, colors, and labels.

A notable design choice is that its table treats a trade as complete only after the whole entry position has been exited, which can differ from the platform’s order-based trade accounting. The excerpt includes example logic based on a moving-average crossover and a buy-and-hold comparison, but it does not provide empirical performance findings. Some fields in the sample are initialized with placeholder or platform values, so users should check how each statistic is calculated and populated before relying on the displayed results.

Key ideas

  • The library organizes strategy results into overall, winning-trade, and losing-trade statistics.
  • Its measures cover returns, variability, streaks, position size, capital risk, and trade management outcomes.
  • A trade is counted as complete after the full position exits, which may differ from order-based platform statistics.
  • The library also supports seasonal performance displays and configurable chart-table formatting.
  • The example demonstrates reporting functionality rather than evidence that its sample moving-average strategy is profitable.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.