INVITE-ONLY SCRIPT

📊 Multi-Ticker SMA Distance & Trend Table - SAINT

27
📊 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.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.