OPEN-SOURCE SCRIPT

Trend Degree Dashboard (Table)

215
๐Ÿ“ˆ Trend Degree Dashboard (Table) โ€” v1.0
This indicator calculates and displays the trend angle (in degrees) based on the linear regression of the selected source (default: close) over a user-defined lookback period (default: 21 bars).
The trend angle gives a quick visual reference of the current market slope โ€” positive (uptrend) or negative (downtrend).

A dashboard table shows the trend angle directly on the chart, with a background color:

๐ŸŸฉ Green background for positive angles (uptrend)

๐ŸŸฅ Red background for negative angles (downtrend)

๐Ÿ”ง Features:
Customizable Lookback Period: Set the number of candles to consider for trend calculation.

Source Selection: Apply the analysis to close, open, high, low, or any other price series.

Dashboard Positioning: Choose where the dashboard appears (Top Left, Top Right, Bottom Left, Bottom Right).

Clean Table Design: Minimalistic and easy-to-read dashboard with automatic background color highlighting based on trend direction.

โš™๏ธ How It Works:
It uses Linear Regression to measure the slope between two consecutive points.

Converts the slope into degrees using the arctangent function (atan) for a geometric interpretation of trend strength and direction.

Updates the dashboard table live with the latest angle value.

โœ… Script Highlights:
Non-repainting: Once a bar closes, its value is fixed.

Efficient performance: Lightweight table visualization with no heavy calculations.

Clear trading signals: Positive angles suggest bullish momentum, negative angles suggest bearish momentum.

โš ๏ธ Disclaimer:
This script is a technical analysis tool designed to assist in decision-making but does not guarantee results.
Please use it alongside other tools and practice proper risk management. Always test any indicator on demo accounts before applying it to live trading.

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.