Schaff Trend Cycle
systemic:core-stcIndicatorsfunction1 crInputs
| Name | Type | Description |
|---|---|---|
| Slow Window | integer | The period for the long (slow) EMA in the MACD calculation. |
| Fast Window | integer | The period for the short (fast) EMA in the MACD calculation. |
| Cycle | integer | The lookback period for the stochastic calculations applied to the MACD. |
| First Smooth Factor | float | Smoothing applied after the first stochastic calculation. |
| Second Smooth Factor | float | Smoothing applied after the second stochastic calculation (final output). |
| Price Data | floatarray | The price series used to calculate the underlying MACD component of the STC. |
Outputs
| Name | Type | Description |
|---|---|---|
| STC | floatarray | The Schaff Trend Cycle oscillator value, ranging from 0 to 100. |
The Speed Problem
In the 1990s, currency trader Doug Schaff faced a frustration familiar to every technical analyst: the MACD was too slow. By the time it confirmed a trend, much of the move had already passed.
Schaff's insight was elegant: Why not apply stochastic calculations to MACD itself? The stochastic oscillator excels at measuring where a value sits within a recent range—applied twice in succession, it would compress the MACD's sluggish movements into a faster, bounded oscillator.
The result was the Schaff Trend Cycle—a hybrid indicator designed specifically for the fast-paced forex markets, where trend detection speed can mean the difference between profit and loss.
The Double Stochastic: Core Innovation
The STC's secret is its double stochastic smoothing:
flowchart TD
subgraph Step1["Step 1: Calculate MACD"]
Fast["Fast EMA (23)"]
Slow["Slow EMA (50)"]
MACD["MACD = Fast - Slow"]
end
subgraph Step2["Step 2: First Stochastic"]
S1["Where is MACD within its range?"]
PF["Percent F (smoothed)"]
end
subgraph Step3["Step 3: Second Stochastic"]
S2["Where is Percent F within its range?"]
STC["STC (0-100)"]
end
Fast & Slow --> MACD --> S1 --> PF --> S2 --> STC
Why does this work?
- MACD captures trend momentum (but unbounded and slow)
- First stochastic normalizes MACD to 0-100 and accelerates its turns
- Second stochastic further smooths while maintaining speed
The result oscillates between 0 and 100, with faster trend detection than the raw MACD.
Interpretation
| STC Zone | Reading | Market Implication |
|---|---|---|
| Bullish | 75-100 | Strong uptrend; potential overbought |
| Neutral | 25-75 | Transition; trend developing or fading |
| Bearish | 0-25 | Strong downtrend; potential oversold |
⚠️ Critical insight: Unlike RSI, values staying in extreme zones (>75 or <25) are often confirming a strong trend, not warning of reversal. Exit signals come when STC leaves these zones.
Trading Signals
Threshold Crossovers
| Signal | Condition | Interpretation |
|---|---|---|
| Buy | STC crosses above 25 | Leaving oversold; uptrend initiating |
| Sell | STC crosses below 75 | Leaving overbought; downtrend initiating |
Trend Confirmation
| STC Behavior | What It Means |
|---|---|
| Holding > 75 | Strong uptrend in progress |
| Holding < 25 | Strong downtrend in progress |
| Oscillating 25-75 | Ranging market; use caution |
Speed Advantage Over MACD
flowchart LR
subgraph MACD_Signal["MACD Signal"]
M1["Trend begins"]
M2["MACD crosses signal line"]
M3["Signal confirmed"]
end
subgraph STC_Signal["STC Signal"]
S1["Trend begins"]
S2["STC crosses 25/75"]
S3["Earlier entry"]
end
M1 -->|"Lag"| M2 --> M3
S1 -->|"Less lag"| S2 --> S3
In back-tests, STC often signals trend changes 3-5 bars earlier than traditional MACD crossovers.
Parameters
| Parameter | Default | Purpose |
|---|---|---|
| Slow Window | 50 | Long EMA period for MACD calculation |
| Fast Window | 23 | Short EMA period for MACD calculation |
| Cycle | 10 | Stochastic lookback period |
| Smooth 1 | 3 | First stochastic smoothing factor |
| Smooth 2 | 3 | Second stochastic smoothing factor |
Parameter Tuning
- Shorter cycle (5-8): Faster signals, more noise
- Longer cycle (12-20): Smoother, more lag
- Smoothing factors: Higher = smoother but slower
When STC Excels
- Strong trending markets — Catches trends early and holds
- Forex and crypto — Designed for fast-moving, 24-hour markets
- Swing trading — 4H and daily timeframes
- Trend confirmation — As a filter alongside other indicators
When STC Struggles
- Ranging/choppy markets — Oscillates without clear direction
- Very short timeframes — Noise can overwhelm signals
- Low-volatility assets — May produce false signals
- Fundamental-driven moves — News events ignore technical levels
Missing Data
Gaps in price_data (closed-market weekends/holidays, missing prints) are None — never a sentinel 0.0 "buy signal", never a value fabricated through a still-warm ewm carried across the gap:
| Scenario | Output |
|---|---|
| Closed-market gap | None at that slot; the whole pipeline (both MACD EMAs, the cycle-window stochastic, both smoothing EMAs) resumes from the last observed bar's state, bridging the gap as an adjacent bar |
| Warm-up (not yet enough observed bars through every stage) | None — never the retired fabricated 0.0 |
| All bars missing | Every slot None, no crash |
| Live tick on a gap slot | [None] — correct and non-starving, not the retired stale/carried value |
Because STC's stochastic-of-stochastic-of-MACD state is recursive, a gap reappearing near the end of the series delays how quickly the indicator "catches up" after the gap resolves, the same way a resumed PSAR reversal lags a fresh one — this is a genuine cost of state-carry, not a bug.
STC vs. Related Indicators
| Indicator | Speed | Range | Best Use |
|---|---|---|---|
| STC | Fastest | 0-100 | Early trend detection |
| MACD | Moderate | Unbounded | Trend strength/divergences |
| Stochastic | Fast | 0-100 | Overbought/oversold reversals |
| RSI | Moderate | 0-100 | Momentum, divergences |
Summary
| Aspect | Detail |
|---|---|
| Full Name | Schaff Trend Cycle |
| Creator | Doug Schaff (1990s) |
| Core Idea | Double stochastic of MACD for speed |
| Range | 0-100 |
| Buy Signal | Crosses above 25 |
| Sell Signal | Crosses below 75 |
| Strength | Faster than MACD, bounded output |
| Weakness | Complex, whipsaws in ranges |
Indicator Assessment
%%{init: {'theme': 'base', 'themeVariables': {'quadrant1Fill': '#e8f5e9', 'quadrant2Fill': '#e3f2fd', 'quadrant3Fill': '#fff3e0', 'quadrant4Fill': '#fce4ec', 'quadrantTitleFill': '#f5f5f5'}}}%%
quadrantChart
title STC - Complexity vs. Reliability
x-axis Low Complexity --> High Complexity
y-axis Low Reliability --> High Reliability
quadrant-1 Efficient Power
quadrant-2 Complex Value
quadrant-3 Limited Use
quadrant-4 Simple Trade-off
STC-Stocks: [0.60, 0.60]
STC-Crypto: [0.60, 0.55]
Five-Dimension Rating
| Dimension | Stocks | Crypto | Rationale |
|---|---|---|---|
| Popularity | 6/10 | 7/10 | Niche indicator; known in forex circles but less mainstream than MACD or RSI. Growing crypto awareness. |
| Reliability | 6/10 | 5.5/10 | Works well in trending markets but struggles in ranges. Higher volatility in crypto increases false signals. |
| Complexity | 6/10 | 6/10 | Double stochastic of MACD requires moderate understanding. Not beginner-friendly conceptually. |
| Versatility | 6/10 | 6.5/10 | Best for trending markets and swing trading. Limited use in mean-reversion or ranging scenarios. |
| Recent Interest | 5/10 | 6/10 | Steady but specialized interest. Crypto traders discovering its speed advantage over MACD. |