OPEN-SOURCE SCRIPT
Regime Overlay — 30m/1h Supertrend + Tint + Flip Alerts

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.
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.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.