OPEN-SOURCE SCRIPT

Trend Bias Table

340
Trend Bias Table — Indicator Description

Type: Overlay indicator (displays directly on the price chart, top-right corner)

What It Does

Trend Bias Table shows a multi-timeframe directional bias panel — Day, 4 Hour, 1 Hour, and 15 Minute — without using any moving averages. Each timeframe is scored independently as Bullish, Bearish, or Neutral based on pure price action.

How the Bias Is Calculated

For each timeframe, three independent factors are scored:

Market Structure — Detects swing pivot highs/lows (via ta.pivothigh / ta.pivotlow) and compares the two most recent pivots:
Higher High + Higher Low → bullish structure
Lower High + Lower Low → bearish structure
Momentum — A Rate of Change (ROC) calculation measures whether price has moved up or down over a smoothing period, with no lag-inducing moving average involved.
Price vs. Open — Checks whether the current close is trading above or below that timeframe's opening price.

Each factor contributes one point to either a bullish or bearish score. Whichever score is higher determines that timeframe's bias; a tie results in Neutral.

What's Displayed

A clean 2-column, 5-row table pinned to the top-right of the chart:

TIMEFRAME BIAS
Day ▲ BULL / ▼ BEAR / ● NEUT
4 Hour ▲ BULL / ▼ BEAR / ● NEUT
1 Hour ▲ BULL / ▼ BEAR / ● NEUT
15 Min ▲ BULL / ▼ BEAR / ● NEUT
Teal = Bullish
Red = Bearish
Grey = Neutral
Inputs
Swing Pivot Length (default 5) — sensitivity of pivot detection for structure analysis
ROC Smoothing (default 3) — lookback period for the momentum calculation
Use Case

Gives traders a fast, at-a-glance read on trend alignment across timeframes — useful for confirming whether a lower-timeframe setup agrees with the higher-timeframe trend, without cluttering the chart with moving average lines.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน