INVITE-ONLY SCRIPT

๐Ÿ“Š Multi-Ticker SMA Distance & Trend Table - SAINT

22
๐Ÿ“Š Multi-Ticker SMA Distance & Trend Dashboard (Private Indicator)
๐Ÿ” Overview

This indicator creates a real-time dashboard on your TradingView chart showing the price distance from the SMA(20) and SMA(200) for up to 10 tickers, along with their trend status and directional arrow based on recent candles.

It is designed for traders who want a quick, side-by-side comparison of multiple assets (stocks, futures, crypto) to identify which are trending, stretched from moving averages, or approaching key support/resistance areas.

โš™๏ธ Key Features
๐Ÿงฉ Multi-Ticker Support

Accepts manual ticker input (comma-separated list, up to 10 tickers).

Optionally includes the current chart symbol automatically.

โฑ๏ธ Timeframe Logic

Uses custom timeframe if provided.

Automatically defaults to the chartโ€™s timeframe if not specified.

Each symbol is auto-validated โ€” if the requested timeframe is unsupported, it falls back intelligently:

Futures โ†’ 60-minute

Crypto โ†’ 4-hour

Stocks โ†’ Daily

If all fail โ†’ chart timeframe

๐Ÿ“ Distance Calculation

For each symbol:
It shows the distance of current price from SMA(20) and SMA(200) in points and percentage format.
Example: +5.12 (+1.23%)

๐Ÿ“ˆ Trend Classification

Includes direction arrow (โ–ฒ / โ–ผ) based on recent trend of the last N candles (user-defined input).

๐Ÿ“Š Sorting Options

Sort dashboard rows dynamically by:

Distance from SMA(20)

Distance from SMA(200)

Trend Strength

or keep original order

๐ŸŽจ Display & Layout

Draws a table directly on the main chart (overlay=true)

Configurable table position: Top-Left / Top-Right / Bottom-Left / Bottom-Right (default = Bottom-Left)

Each cell color-coded by distance:

Green โ†’ price above SMA

Red โ†’ price below SMA

Footer line shows timeframe, sorting mode, number of fallbacks used, and skipped tickers.

๐Ÿง  Example Use-Cases
Example 1 โ€“ Daily Trend Comparison

Input:

AAPL, MSFT, TSLA, AMZN, NVDA, META
Custom Timeframe: D


Output:
A compact dashboard showing each tickerโ€™s distance from its daily SMAs โ€” helping you see which are extended (potential mean-reversion plays) or trending cleanly.

Example 2 โ€“ Futures Dashboard

Input:

ES1!, NQ1!, YM1!, RTY1!, CL1!, GC1!
Custom Timeframe: 60


If some futures symbols donโ€™t support the exact 60-min resolution, the indicator automatically falls back to the next best timeframe.

Example 3 โ€“ Mixed Watchlist with Auto Chart Symbol

Input:

AAPL, BTCUSD, ETHUSD, NQ1!
Auto-Include Chart Symbol: โœ…
Custom Timeframe: blank


The dashboard uses your chartโ€™s current timeframe and merges both stocks and crypto seamlessly.

๐Ÿงพ Example Dashboard Layout
Ticker Dist SMA(20) Dist SMA(200) Trend
AAPL +2.35 (+1.1%) +20.40 (+9.3%) ๐ŸŸข Buy โ–ฒ
MSFT -1.25 (-0.4%) +15.30 (+5.2%) ๐ŸŸ  Neutral
TSLA -12.10 (-4.9%) -40.70 (-15.0%) ๐Ÿ”ด Sell โ–ผ

TF: D | Sorted: SMA(20)% | Fallbacks: 1 | Skipped: 0

๐Ÿงฉ Inputs Summary
Input Description
Manual Tickers Comma-separated list (up to 10)
Auto-Include Chart Symbol Adds current chart ticker automatically
Custom Timeframe Overrides chart TF if supported
Use Custom Timeframe? Enables/disables custom TF
Table Position Choose table placement (default: Bottom Left)
Candles for Trend Arrow Number of bars to analyze for short-term trend
Sort By Sorting preference for dashboard

โš ๏ธ Notes

For best performance, limit to โ‰ค10 symbols.

Pine does not allow reading actual TradingView watchlists directly โ€” you must manually input tickers or use the chart symbol auto-include option.

Table updates only on last bar for performance reasons.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.