Indicator · Pine Script v5 · On the chart

Performance

by regalouisei· code credited to BeeHolder

The Performance indicator calculates percentage price changes across multiple customizable higher timeframes, displaying the results in an on-screen dashboard table overlay.

View on GitHub

Repaints

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code126
Settings21inputs
LicenceNone statedfile: MPL-2.0
Last update8 months ago25 Feb 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

126 lines of Pine Script v5 from pinescript/editors_picks/performance-table.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

performance-table.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © BeeHolder

//@version=5
indicator("Performance", overlay=true)

tableColumnsInput = input.int(3, "Number of columns", group = "Table Settings")

tooltipText = "Custom timeframes can be added via the chart's Timeframe dropdown. Until added, custom timeframes show up as 'Chart' instead."
showTF1 = input.bool(true,   "", inline = "TF1", group = "Absolute timeframes")
tf1 = input.timeframe("1W",  "", inline = "TF1", group = "Absolute timeframes", tooltip = tooltipText)
showTF2 = input.bool(true,   "", inline = "TF2", group = "Absolute timeframes")
tf2 = input.timeframe("1M",  "", inline = "TF2", group = "Absolute timeframes")
showTF3 = input.bool(true,   "", inline = "TF3", group = "Absolute timeframes")
tf3 = input.timeframe("3M",  "", inline = "TF3", group = "Absolute timeframes")
showTF4 = input.bool(true,   "", inline = "TF4", group = "Absolute timeframes")
tf4 = input.timeframe("6M",  "", inline = "TF4", group = "Absolute timeframes")
showTF5 = input.bool(true,   "", inline = "TF5", group = "Absolute timeframes")
tf5 = input.timeframe("9M",  "", inline = "TF5", group = "Absolute timeframes")
showTF6 = input.bool(true,   "", inline = "TF6", group = "Absolute timeframes")
tf6 = input.timeframe("52W", "", inline = "TF6", group = "Absolute timeframes")
showTF7 = input.bool(true,   "", inline = "TF7", group = "To Date timeframes")
tf7 = input.timeframe("1M",  "", inline = "TF7", group = "To Date timeframes")
showTF8 = input.bool(true,   "", inline = "TF8", group = "To Date timeframes")
tf8 = input.timeframe("3M",  "", inline = "TF8", group = "To Date timeframes")
showTF9 = input.bool(true,   "", inline = "TF9", group = "To Date timeframes")
tf9 = input.timeframe("12M", "", inline = "TF9", group = "To Date timeframes")

var showTFArray = array.from(showTF1, showTF2, showTF3, showTF4, showTF5, showTF6, showTF7, showTF8, showTF9)
var timeframesArray = array.from(tf1, tf2, tf3, tf4, tf5, tf6, tf7, tf8, tf9)

if barstate.isfirst
    for i = 0 to array.size(showTFArray) - 1
        tf = array.get(timeframesArray, i)
        if not na(str.tonumber(tf))
            runtime.error(str.format("Intraday timeframes (`{0}` in Timeframe #{1}) are not compatible with this indicator.", tf, i + 1))

var table perfTable = table.new(position.top_right, tableColumnsInput, 9, border_width = 3)

LIGHTTRANSP = 90
AVGTRANSP   = 80
HEAVYTRANSP = 70

posColorInput = input(color.rgb(38, 166, 154), title="Positive Color")
negColorInput = input(color.rgb(240, 83, 80), title="Negative Color")

timeframeInMS(timeframe) =>
    numTf = str.tonumber(timeframe)
    tfLength = str.length(timeframe)
    
    float tfNumber = na
    string tfLetter = na
    
    if numTf
        tfNumber := numTf
    else
        tfLetter := str.substring(timeframe, tfLength - 1, tfLength)
        tfNumber := str.tonumber(str.substring(timeframe, 0, tfLength - 1))
    
    tfBaseInMS = switch tfLetter
        "S" => 60 * 1000
        "D" => 24 * 60 * 60 * 1000
        "W" => 7 * 24 * 60 * 60 * 1000
        "M" => 30 * 24 * 60 * 60 * 1000
        => 60 * 60 * 1000
    
    int(tfBaseInMS * tfNumber)

fastSearch(source, target) =>
    max_bars_back(source, 366)
    left  = 0
    right = math.min(bar_index, 366)
    mid = 0
    if source < target
        0
    else
        for i = 0 to 9
            mid := math.ceil(math.avg(left, right))
            if left == right
                break
            else if source[mid] < target
                right := mid
                continue
            else if source[mid] > target
                left := mid
                continue
            else
                break
        mid

rateOfreturn(v1, v2) => (v1 - v2) * 100 / math.abs(v2)

performance(timeframe) =>
    sourceTime = barstate.isconfirmed ? time_close : timenow
    barsBack = fastSearch(time, sourceTime - timeframeInMS(timeframe))
    performance = request.security(syminfo.tickerid, "1D", rateOfreturn(close, close[barsBack]), lookahead=barmerge.lookahead_on)
    performance

tf7Sec = request.security(syminfo.tickerid, tf7, close[1], lookahead=barmerge.lookahead_on)
tf8Sec = request.security(syminfo.tickerid, tf8, close[1], lookahead=barmerge.lookahead_on)
tf9Sec = request.security(syminfo.tickerid, tf9, close[1], lookahead=barmerge.lookahead_on)

fillCell(_table, column, row, value, timeframe) =>
    _color = value >= 0 ? posColorInput : negColorInput
    transp = math.abs(value) > 10 ? HEAVYTRANSP : math.abs(value) > 5 ? AVGTRANSP : LIGHTTRANSP
    cellText = str.tostring(value, "0.00") + "%\n" + timeframe
    table.cell(_table, column, row, cellText, bgcolor = color.new(_color, transp), text_color = _color, width = 6)

formatTF(tf) =>
    formattedTF = switch tf
        "52W" => "1Y"
        "12M" => "1Y"
        => tf

changeArray = array.from(performance(tf1), performance(tf2), performance(tf3), 
 performance(tf4), performance(tf5), performance(tf6), rateOfreturn(close, tf7Sec), 
 rateOfreturn(close, tf8Sec),rateOfreturn(close, tf9Sec))
timeframeArray = array.from(formatTF(tf1), formatTF(tf2), formatTF(tf3), formatTF(tf4), 
 formatTF(tf5), formatTF(tf6), formatTF(tf7) + "TD", formatTF(tf8) + "TD", formatTF(tf9) + "TD")

if barstate.islast
    filled = 0
    for i = 0 to array.size(showTFArray) - 1
        if array.get(showTFArray, i)
            fillCell(perfTable, filled % tableColumnsInput, filled / tableColumnsInput, array.get(changeArray, i), array.get(timeframeArray, i))
            filled += 1

Overview

Users can toggle up to nine timeframes, including weekly, monthly, and multi-month periods, and configure positive and negative return colors along with table column formatting. Intraday timeframes are explicitly unsupported by this indicator. It uses lookahead data fetching for higher timeframes to evaluate historical performance metrics.

Details

Published by

regalouisei on GitHub

Code credit

BeeHolder, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Screeners & dashboards

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Reads higher-timeframe data with lookahead on, so the history can show signals that were not there in real time

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Number of columnsint3tableColumnsInput
showTF1booltrueshowTF1
tf1timeframe1Wtf1
showTF2booltrueshowTF2
tf2timeframe1Mtf2
showTF3booltrueshowTF3
tf3timeframe3Mtf3
showTF4booltrueshowTF4
tf4timeframe6Mtf4
showTF5booltrueshowTF5
tf5timeframe9Mtf5
showTF6booltrueshowTF6
Show all 21 settings
SettingTypeDefaultVariable
tf6timeframe52Wtf6
showTF7booltrueshowTF7
tf7timeframe1Mtf7
showTF8booltrueshowTF8
tf8timeframe3Mtf8
showTF9booltrueshowTF9
tf9timeframe12Mtf9
Positive Colorcolorcolor.rgb(38, 166, 154)posColorInput
Negative Colorcolorcolor.rgb(240, 83, 80)negColorInput
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

Symbol Info Helper

by everget
948 stars

Symbol Info Helper is an informational utility script that displays metadata about the currently selected instrument directly on the main price chart. It gathers built-in symbol properties including ticker identifier, description, instrument type, point value,

Indicator v4 Screeners & dashboards
Updated 10 days ago · GPL-3.0 GitHub repository of Symbol Info Helper
575 stars

The indicator plots ICT displacement candles on the price chart and can switch to retracement scanning. Displacement requires a move larger than a set share of the 14-bar average high-low range, lasting at least a chosen number of bars, with optional close, pr

Indicator v6 SMC / ICT / price actionCandlestick patterns
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Displacement Candles Indicator
330 stars

This indicator monitors multiple cryptocurrency symbols for trading signals. It calculates and plots entry prices, take profit, and stop loss levels for each symbol including BTCUSDT, ETHUSDT, BNBUSDT and others. Price crossovers trigger buy, sell or close ale

Indicator v5 Support & resistanceScreeners & dashboards
Updated 2 months ago · None stated GitHub repository of Multi Alert Long/Short [Alorse]

Pricing Table

by namuan
318 stars

This indicator calculates theoretical options contract values and in-the-money probabilities using historical realized volatility across multiple standard deviations. It displays these metrics in a table overlay directly on the price chart. Users can adjust th

Indicator v4 Volatility & bandsScreeners & dashboards
Updated 2 months ago · MIT GitHub repository of Pricing Table

3938 Tracker

by Allen1212
303 stars

3938 Tracker visualizes historical buying and selling activity from ARK Invest funds directly on the main price chart. It plots labels at specific timestamps corresponding to trade dates, indicating buy or sell actions along with the count of participating ETF

Indicator v4 Screeners & dashboards
Updated 2 years ago · None stated GitHub repository of 3938 Tracker

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers