Indicator · Pine Script v6 · On the chart

Dashboard Block Pattern Reference

by MoDarK-MK· code credited to dashboard-block-pattern

Calculates a Simple Moving Average (SMA) and Relative Strength Index (RSI) to render a live status dashboard table on the price chart.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code60
Settings2inputs
LicenceMPL-2.0
Last update7 weeks ago4 Sep 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

60 lines of Pine Script v6 from assets/templates/dashboard_block_template.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

dashboard_block_template.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © dashboard-block-pattern

//@version=6
// Runnable reference for the professional stats-dashboard + gradient-coloring
// patterns described in references/design-system.md. Copy the table.new()/
// cell() pattern into your own indicator/strategy — this file demonstrates it
// standalone so it can be previewed and lint-checked on its own.
indicator("Dashboard Block Pattern Reference", overlay=true)

// ————— Constants (see references/snippets/palette.pine for the full palette)
color BULL_COLOR    = #089981
color BEAR_COLOR    = #f23645
color TEXT_COLOR    = #d1d4dc
color MUTED_COLOR   = #b2b5be
color PANEL_COLOR   = #131722

// ————— Inputs
int  lengthInput        = input.int(14, "Length", minval=1, maxval=2000, group="Settings")
bool showDashboardInput = input.bool(true, "Show Dashboard", group="Appearance")

// ————— Function declarations
// @function One label/value row. Taking both colors as required arguments is
// what prevents a cell shipping without text_color — Pine defaults cell text to
// BLACK, which is invisible on a dark panel or a dark chart.
dashRow(table t, int row, string label, string value, color valueCol) =>
    table.cell(t, 0, row, label, text_color=MUTED_COLOR, text_size=size.small,
         text_halign=text.align_left)
    table.cell(t, 1, row, value, text_color=valueCol, text_size=size.small,
         text_halign=text.align_right)

// ————— Calculations
float maValue  = ta.sma(close, lengthInput)
float rsiValue = ta.rsi(close, lengthInput)
bool  trendUp  = close > maValue
// A gradient turns a number into a reading — but one gradient per pane is the
// limit before the chart starts looking like a heat map.
color rsiColor = color.from_gradient(rsiValue, 30, 70, BEAR_COLOR, BULL_COLOR)

// ————— Visuals
plot(maValue, "MA", color=trendUp ? BULL_COLOR : BEAR_COLOR, linewidth=2)

// Three text weights carry the hierarchy: a normal-size title, muted small
// labels, and primary-color small values. Transparency stays low (15) so the
// candles behind the panel never compete with the numbers.
var table dashboard = table.new(
     position.top_right, 2, 4,
     bgcolor=color.new(PANEL_COLOR, 15), border_width=1,
     border_color=color.new(PANEL_COLOR, 100),
     frame_color=color.new(MUTED_COLOR, 70), frame_width=1)

if showDashboardInput and barstate.islast
    table.cell(dashboard, 0, 0, "DASHBOARD", text_color=TEXT_COLOR,
         text_size=size.normal, text_halign=text.align_center)
    table.cell(dashboard, 1, 0, "", text_color=TEXT_COLOR)
    table.merge_cells(dashboard, 0, 0, 1, 0)
    dashRow(dashboard, 1, "Trend", trendUp ? "Bullish" : "Bearish",
         trendUp ? BULL_COLOR : BEAR_COLOR)
    dashRow(dashboard, 2, "MA", str.tostring(maValue, format.mintick), TEXT_COLOR)
    dashRow(dashboard, 3, "RSI", str.tostring(rsiValue, "#.#"), rsiColor)

Overview

The script plots the SMA line directly on the price chart with color dynamic styling based on market trend direction. On the final bar, it populates a top-right table showing current trend bias, exact SMA value, and gradient-colored RSI reading. Settings allow adjusting the lookback period and toggling the table display.

Details

Published by

MoDarK-MK on GitHub

Code credit

dashboard-block-pattern, as written in the script's header

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Screeners & dashboards, Moving averages, Oscillators & momentum, Trend

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

ci-cdindicatorslinterpine-scriptpythonstrategiestradingview

Settings

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

SettingTypeDefaultVariable
Lengthint14lengthInput
Show DashboardbooltrueshowDashboardInput
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

218 stars

TradersPost Trading Checklist is an overlay indicator that evaluates a suite of popular technical conditions for long and short trade setups. It checks session-anchored VWAP, fast and slow EMA alignments and crosses, 200 SMA, RSI overbought or oversold conditi

Indicator v6 Screeners & dashboardsTrend
Updated 3 months ago · None stated GitHub repository of TradersPost Trading Checklist
53 stars

This indicator analyzes historical candle direction and price range over a configurable lookback window to gauge market trend. It categorizes trend direction using candle count, price range sum, or both. Signals are filtered using a Simple Moving Average to en

Indicator v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of Candle Counter + MA + RSI + Mode

Pocket Scout - SPY/QQQ

by chris-c-thomas
14 stars

Pocket Scout - SPY/QQQ is a mobile-optimized intraday bias indicator designed for major US equity ETFs and indices. It overlays a 9/21/50 EMA ribbon, session VWAP, prior day high/low/close levels, and intraday high/low lines directly on the main price chart. T

Indicator v6 TrendOscillators & momentum Repaints
Updated 6 months ago · MIT GitHub repository of Pocket Scout - SPY/QQQ

Portfolio Backtester

by f-cksociety
11 stars

The script is a Pine Script v5 indicator that emulates strategy backtesting directly on the price chart. It evaluates modular entry strategies, trade directions, entry stop-loss types such as ATR multiples or fixed percentages, and a wide variety of trade filt

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of Portfolio Backtester

ForexAlgo

by Harshil427
7 stars

ForexAlgo generates trade signals directly on the price chart using a primary leading indicator, such as the Range Filter, combined with modular confirmation filters. Traders can toggle multiple technical filters, including exponential moving average crosses,

Indicator v5 TrendOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of ForexAlgo

Lune Algo Premium

by IAMATOMIC001
3 stars

This multi-component overlay indicator plots algorithmic trading signals, trend clouds, and reversal bands directly on the price chart. Users can choose between multiple signal models tailored for scalping, momentum, or swing trading, adjusted via sensitivity

Indicator v5 TrendOscillators & momentum
Updated 12 months ago · None stated GitHub repository of Lune Algo Premium

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