OPEN-SOURCE SCRIPT

Regime Ribbon + Compass

296
Traditional ADX asks you to read three tangled lines at once — +DI, −DI, and the ADX line — and combine them in your head in real time. This tool collapses all three into a single, intuitive read: direction by color, trend strength by height. No sub-pane needed — the entire regime picture lives right on your price chart.

◈ WHAT IT DOES

The Regime Ribbon recolors a smoothed baseline directly on your candles: green when the directional index confirms an uptrend with strength, red for a downtrend with strength, and muted gray during low-ADX chop. An optional faint background tint reinforces the current regime at a glance.

The Regime Compass — a floating right-edge gauge — turns the same read into a live instrument you can check at a glance:

Fill direction shows who's in control: the meter fills upward from its midline when bulls lead (+DI over −DI) and downward when bears lead (−DI over +DI).
Fill color matches the regime: green for an up-regime, red for a down-regime, dim gray during chop.
Fill height encodes conviction: the stronger the trend (higher ADX), the further the meter fills toward its pole. A weak or ranging market barely lifts off the midline; a powerful trend pushes the fill close to the edge.
Bull / Bear poles mark the top and bottom of the gauge so you always know which way is which.
A live readout on the meter prints the current state and ADX value — for example "▲ TREND 34", "▼ TREND 28", or "◈ CHOP 12" — and a light-blue dashed midline marks the neutral point.

One glance answers both questions traders normally have to compute from three separate lines: which way, and how much to trust it. The gauge floats to the right of the last candle so it never sits on top of your price action, and it can be slid further out to taste.

An on-chart dashboard ties everything together in one row along the bottom of the chart — no separate pane. Each cell is a live readout:

REGIME — the current state in plain terms: BULL ▲, BEAR ▼, or CHOP ◈, colored to match.
ADX — the raw ADX value plus a word for context: WEAK (below the trend threshold), TREND (trend confirmed), or STRONG (a powerful move).
STRENGTH — a compact bar that fills with ADX, so you can gauge trend power without reading the number.
+DI — the positive directional value (up-pressure).
−DI — the negative directional value (down-pressure).
BALANCE — the two directional values distilled into a single signed percentage. Positive means bulls lead, negative means bears lead, and the size shows how lopsided it is. This is the "collapsed" read at the heart of the tool.
TP/SL — the take-profit and stop-loss distances currently configured, with their unit (percent or ATR).
COOLDOWN — how many bars remain before a new signal is allowed, or "clear" when it's ready.
STATUS — the current position state: FLAT, LONG ●, or SHORT ●.

Together the ribbon, compass, and dashboard give you the full regime picture — direction, strength, the underlying directional balance, your trade parameters, and current state — all on the price chart, readable in a single glance.

◈ HOW TO USE

Read it in two steps — direction, then conviction:

Ribbon and compass green with the meter filling high → an uptrend with conviction. Continuation-style approaches tend to suit these conditions, and the taller the compass fill, the more decisive the move.
Red with the meter filling low → a downtrend with conviction.
Ribbon dim gray and the compass short (hugging the midline) → ADX is low; a chop/range regime where trend-following is prone to whipsaw and range tactics tend to fit better. Many traders simply stand aside here.
Watch the BALANCE cell and the compass together: when balance swings from negative to positive (or vice-versa) and the compass starts filling with height, that's the regime waking up — the shift from chop into a directional move.
Optional markers and funnel labels highlight the exact moment the regime flips into a confirmed strong trend, drawing example take-profit and stop-loss reference levels on the chart so you can see the setup framed end to end.

A practical workflow: use the ribbon for your at-a-glance bias, the compass for how much weight to give it, the BALANCE cell to spot early shifts, and the STATUS/COOLDOWN cells to keep your own entries disciplined.

◈ SETTINGS

Regime Engine — DI Length, ADX Smoothing, Trend Threshold (the ADX level separating trend from chop), Strong-Trend level.
Regime Ribbon — baseline length, background tint toggle.
Regime Compass — right-edge offset, width, height (in ATR).
Trade Levels — TP/SL in Percent or ATR, ATR length, TP/SL box toggle.
Risk Management — cooldown between signals, max bars in trade, optional EOD flatten window.
Webhook — optional alert payload with a configurable strategy ID.
Dashboard — on/off.

◈ NON-REPAINTING

All signals evaluate only on confirmed (closed) bars, and every directional value is read from closed bars — so a signal that prints will not disappear or shift intrabar. Entry logic arms on the signal bar's close and references the next bar's open, matching realistic order timing. No future data is used anywhere in the logic.

◈ DISCLAIMER

This script is a technical-analysis tool provided for educational and informational purposes only. It is not financial advice, does not predict future price movement, and does not guarantee any outcome. Trading carries a substantial risk of loss. Always do your own research and manage your own risk. The past behavior of any indicator or market condition does not indicate future results.

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

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