Displaying Strategy Performance as a Monthly Return Chart
Summary
This script demonstrates how to display a strategy’s month-by-month profit and loss as a table-based bar chart in TradingView. It calculates each bar’s change in strategy equity, compounds those changes within the month, and stores completed monthly returns with their dates. The table plots positive and negative results in different colors around a zero line, scales bar heights to the largest absolute monthly return, and labels the months and years.
The strategy used to generate the illustration enters around confirmed pivot highs and lows, with stop entries beyond the pivot levels. The author describes that strategy as an example and emphasizes that the script’s purpose is performance display. The chart is a compact historical summary, not a risk-adjusted evaluation: it does not itself explain drawdowns, exposure, trade costs beyond the configured commission, or whether results generalize. The return series depends on the underlying strategy settings and backtest assumptions, and past performance does not establish future returns.
Key ideas
- Monthly equity changes are compounded within each calendar month to produce monthly returns.
- A table object can render signed return bars around a zero line when a native chart type is unavailable.
- The display scales bar heights relative to the largest absolute monthly result in the stored sample.
- The included pivot strategy is illustrative; the visualization does not establish strategy quality or future performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.