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.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.