OPEN-SOURCE SCRIPT
Sweep Trend Chop Filter (STCF)

Sweep Trend Chop Filter (STCF) is a price‑action trend tool that colors candles based on trend strength, momentum shifts, and chop conditions. It combines a 4‑MA stack with a CISD state‑machine to highlight true bullish/bearish moves while filtering out noise. A fast, visual trend filter for any timeframe.
Bullish: MA9 > MA18 ≥ MA27 ≥ MA50 → bars colored green
Bearish: MA9 < MA18 ≤ MA27 ≤ MA50 → bars colored red
Otherwise = Chop (yellow)
MA Stack (Primary Trend): Uses four moving averages (9/18/27/50) with a loosened stacking rule to identify trend bias.
CISD State (Momentum Confirmation): Confirms flips only on confirmed bars by tracking a red→green (bearish → bullish) or green→red (bullish → bearish) transition, then measuring follow‑through using the Noise Filter tolerance. When met, CISD can temporarily color bars even if the MA stack hasn’t aligned yet.
Full Candle Coloring: Bodies, wicks, and borders are colored for immediate visual clarity, with optional overlay of the 4 MAs.
Inputs
Noise Filter (0–1): Tighten/loosen CISD confirmation sensitivity (default 0.7).
Swing Period: For future extensions (placeholder).
MA Type: EMA (default) or SMA.
MA Lengths: 9 / 18 / 27 / 50 (editable).
Colors: Bullish, Bearish, Chop.
Toggle: Show/Hide MAs.
Tips & Notes
Go to Settings of Chart (not the indicator) and Disable Colored Body, Wick, and Outline.
Use STCF to stay with trend, avoid chop, and time transitions with CISD confirmation.
Best paired with higher‑timeframe confluence and risk controls.
No signals/alerts are fired—visual filter only.
Bullish: MA9 > MA18 ≥ MA27 ≥ MA50 → bars colored green
Bearish: MA9 < MA18 ≤ MA27 ≤ MA50 → bars colored red
Otherwise = Chop (yellow)
MA Stack (Primary Trend): Uses four moving averages (9/18/27/50) with a loosened stacking rule to identify trend bias.
CISD State (Momentum Confirmation): Confirms flips only on confirmed bars by tracking a red→green (bearish → bullish) or green→red (bullish → bearish) transition, then measuring follow‑through using the Noise Filter tolerance. When met, CISD can temporarily color bars even if the MA stack hasn’t aligned yet.
Full Candle Coloring: Bodies, wicks, and borders are colored for immediate visual clarity, with optional overlay of the 4 MAs.
Inputs
Noise Filter (0–1): Tighten/loosen CISD confirmation sensitivity (default 0.7).
Swing Period: For future extensions (placeholder).
MA Type: EMA (default) or SMA.
MA Lengths: 9 / 18 / 27 / 50 (editable).
Colors: Bullish, Bearish, Chop.
Toggle: Show/Hide MAs.
Tips & Notes
Go to Settings of Chart (not the indicator) and Disable Colored Body, Wick, and Outline.
Use STCF to stay with trend, avoid chop, and time transitions with CISD confirmation.
Best paired with higher‑timeframe confluence and risk controls.
No signals/alerts are fired—visual filter only.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.