OPEN-SOURCE SCRIPT
Regime Guard (Clean Background) - Free v1.0.1 [VBS]

This indicator is built with one simple objective:
Help traders avoid trading when the market environment is unfavorable.
Instead of generating buy or sell signals, Regime Guard focuses on identifying whether the market is in a No-Trade (compression/choppy) condition or a Tradable (normal expansion) state.
It is designed to be used alongside trend or momentum tools — not as a standalone entry system.
What It Does
1) Detects Volatility Compression (Squeeze)
Using Bollinger Band Width percentile, the script identifies periods where volatility is unusually low compared to its recent history.
Low volatility often leads to:
False breakouts
Whipsaws
Overtrading losses
When compression is detected and trend strength is weak, the background turns gray, signaling a No-Trade environment.
2) Measures Trend Strength (DMI / ADX)
The script evaluates whether the market is trending or choppy using ADX.
Low ADX → weak structure, higher risk of random movement
Rising ADX → strengthening directional movement
This helps differentiate between:
Quiet compression
Genuine expansion
Market States
The indicator operates with clean, minimal states:
Gray Background → NO-TRADE
Market is compressed and trend strength is weak. Risk of chop is elevated.
Subtle Green Background → TRADABLE
Market conditions are normal and potentially suitable for setups.
No arrows.
No direction bias.
No false promises.
This tool is about environment filtering, not prediction.
Optional READY Hint
A “READY” event can be enabled to highlight when:
The market exits a squeeze
Or ADX begins rising above a defined threshold
By default, this marker is turned off to maintain a clean chart.
Important:
READY does not mean Buy or Sell.
It simply means market conditions may be shifting back toward tradable behavior.
How to Use It
A simple workflow:
Use a trend indicator to determine direction
Use a momentum tool for timing
Use Regime Guard to confirm the environment is tradable
If the background is gray, consider standing aside.
If conditions are tradable, then look for structured setups.
Why This Exists
Many traders don’t lose because of bad entries.
They lose because they trade in the wrong market conditions.
Regime Guard is designed to reduce that mistake.
It won’t tell you where to buy or sell.
It will help you decide when it makes sense to participate at all.
— VictoryByStrategy
Help traders avoid trading when the market environment is unfavorable.
Instead of generating buy or sell signals, Regime Guard focuses on identifying whether the market is in a No-Trade (compression/choppy) condition or a Tradable (normal expansion) state.
It is designed to be used alongside trend or momentum tools — not as a standalone entry system.
What It Does
1) Detects Volatility Compression (Squeeze)
Using Bollinger Band Width percentile, the script identifies periods where volatility is unusually low compared to its recent history.
Low volatility often leads to:
False breakouts
Whipsaws
Overtrading losses
When compression is detected and trend strength is weak, the background turns gray, signaling a No-Trade environment.
2) Measures Trend Strength (DMI / ADX)
The script evaluates whether the market is trending or choppy using ADX.
Low ADX → weak structure, higher risk of random movement
Rising ADX → strengthening directional movement
This helps differentiate between:
Quiet compression
Genuine expansion
Market States
The indicator operates with clean, minimal states:
Gray Background → NO-TRADE
Market is compressed and trend strength is weak. Risk of chop is elevated.
Subtle Green Background → TRADABLE
Market conditions are normal and potentially suitable for setups.
No arrows.
No direction bias.
No false promises.
This tool is about environment filtering, not prediction.
Optional READY Hint
A “READY” event can be enabled to highlight when:
The market exits a squeeze
Or ADX begins rising above a defined threshold
By default, this marker is turned off to maintain a clean chart.
Important:
READY does not mean Buy or Sell.
It simply means market conditions may be shifting back toward tradable behavior.
How to Use It
A simple workflow:
Use a trend indicator to determine direction
Use a momentum tool for timing
Use Regime Guard to confirm the environment is tradable
If the background is gray, consider standing aside.
If conditions are tradable, then look for structured setups.
Why This Exists
Many traders don’t lose because of bad entries.
They lose because they trade in the wrong market conditions.
Regime Guard is designed to reduce that mistake.
It won’t tell you where to buy or sell.
It will help you decide when it makes sense to participate at all.
— VictoryByStrategy
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.