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.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.