OPEN-SOURCE SCRIPT

Regime Overlay — 30m/1h Supertrend + Tint + Flip Alerts

91
One-liner

Fast/slow Supertrend (30m & 1h) with majority-vote bias tinting and flip alerts—quickly see when structure changes.

What it does

Plots 30m (fast) and 1h (slow) Supertrend lines.

Computes a majority regime (Bull / Bear / Mixed) from the 30m & 1h directions.

Tints candles by the majority regime (green = bull, red = bear, orange = mixed).

Marks and alerts on regime flips (30m, 1h, and Majority).

How it works

Uses TradingView’s built-in ta.supertrend(multiplier, atrLength) on 30m and 1h via MTF security calls.

Direction is +1 (up) or –1 (down). The majority vote is the sum of both directions:

0 → Bull Regime

< 0 → Bear Regime

= 0 → Mixed (disagreement)

Inputs

TF A / TF B: default 30m and 1h (change if you prefer other pairs).

ATR Length, Multiplier: Supertrend parameters (defaults 10 & 3.0).

Toggles: Show 30m, Show 1h, Tint candles, Tint transparency, Flip markers.

Alerts included

30m Flip Up/Down

1h Flip Up/Down

Majority Regime Flip Up/Down
Turn on the ones you care about (fast flips for scalps, 1h/majority for bigger bias shifts).

How to use

Keep both lines visible to read fast vs slow structure.

Use the tint as a quick bias filter; trade only with the prevailing color if that’s your style.

Combine with your entries/exits (e.g., RSI/volume/price action); the overlay provides context, not signals.

If you change the TFs, retune ATR/Multiplier to match volatility.

Notes

MTF behavior: The 30m/1h values finalize on their bar close; they may update intra-bar.

Works on crypto, FX, stocks; parameters may need per-asset tuning.

Credits

Built by @hacklenajee with GPT-5 Thinking (ChatGPT).
For education/research only. Not financial advice.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.