OPEN-SOURCE SCRIPT
Schaff Trend Cycle (STC) - t0rdn3

Schaff Trend Cycle (STC)
By t0rdn3 (original STC by [SHK], now with more descriptive naming)
Description
The Schaff Trend Cycle (STC) is a momentum-based oscillator that combines the speed of a fast EMA crossover with cyclical normalization. Developed by Doug Schaff, it identifies market turning points more responsively than MACD or RSI.
How It Works
1. EMA Difference: Calculates the difference between two EMAs of the source series (default: close).
2. Cycle Percentage: Normalizes that difference to a 0–100 range over the cycle period.
3. Smoothing: Applies exponential smoothing twice—first to the cycle percentage, then to its normalized cycles—to reduce noise.
4. Final STC Line: Produces a smoothed oscillator oscillating between 0 and 100.
Alerts
- "STC turned down above 75": Fires once when STC makes a local peak above the upper threshold (75).
- "STC turned up below 25": Fires once when STC makes a local trough below the lower threshold (25).
Inputs
Usage
Readings above 75 indicate an overbought cycle; readings below 25 indicate an oversold cycle. Crossings of the 50 midline can confirm trend direction:
- STC rising through 50 → bullish shift
- STC falling through 50 → bearish shift
Combine STC with price action or other trend filters to improve signal quality. You can adjust the cycle period and EMA lengths to match different timeframes or instruments.
By t0rdn3 (original STC by [SHK], now with more descriptive naming)
Description
The Schaff Trend Cycle (STC) is a momentum-based oscillator that combines the speed of a fast EMA crossover with cyclical normalization. Developed by Doug Schaff, it identifies market turning points more responsively than MACD or RSI.
How It Works
1. EMA Difference: Calculates the difference between two EMAs of the source series (default: close).
2. Cycle Percentage: Normalizes that difference to a 0–100 range over the cycle period.
3. Smoothing: Applies exponential smoothing twice—first to the cycle percentage, then to its normalized cycles—to reduce noise.
4. Final STC Line: Produces a smoothed oscillator oscillating between 0 and 100.
Alerts
- "STC turned down above 75": Fires once when STC makes a local peak above the upper threshold (75).
- "STC turned up below 25": Fires once when STC makes a local trough below the lower threshold (25).
Inputs
- Cycle Period: 12 — Lookback in bars for normalization
- Fast EMA Length: 26 — Period of the fast EMA
- Slow EMA Length: 50 — Period of the slow EMA
- Smoothing Factor: 0.5 — Exponential smoothing coefficient (0–1)
Usage
Readings above 75 indicate an overbought cycle; readings below 25 indicate an oversold cycle. Crossings of the 50 midline can confirm trend direction:
- STC rising through 50 → bullish shift
- STC falling through 50 → bearish shift
Combine STC with price action or other trend filters to improve signal quality. You can adjust the cycle period and EMA lengths to match different timeframes or instruments.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.