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.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.