Downloading...
OPEN-SOURCE SCRIPT

SMA Zone with Breakouts/Tests 1.0.

905
This indicator plots a dynamic “SMA Zone” between two simple moving averages (one applied to lows, one to highs) and highlights key interaction points with the zone:

Breakouts

Bull Break: price closes above the upper SMA

Bear Break: price closes below the lower SMA

Requires confirmation via either above-average volume or an unusually wide bar (spread > ATR) closing near its extreme

Tests & Retests

After a breakout, the first re-entry into the zone edge is labeled “Test,” subsequent re-entries are numbered “Retest,” “2nd Retest,” etc.

Zone Weakening: each additional Test/Retest signifies diminished zone strength—fewer reliable boundaries remain (Traditional S/R theory)
Alerts

Fires a unified “Zone Signal” alert on every Break, Test, and Retest (set condition to “Any alert() function call”).

Disclaimer:

This is not financial advice and should not be used as a standalone trading signal.

It’s designed to draw your attention to important price-zone interactions so you can manually tune in.

The logic can be further enhanced or combined with other indicators/algorithms as part of a more complex trading system.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.