Schaff Trend Cycle (STC)

Category: Screeners By: Iván González Created: June 18, 2026, 2:08 PM
June 18, 2026, 2:08 PM
Screeners
0 Comments

The Schaff Trend Cycle (STC) is one of those oscillators that traders love.

What the Schaff Trend Cycle Is

Doug Schaff started from a simple observation: the MACD trends in cycles, but it is slow and unbounded. The STC runs the MACD through a double stochastic with double smoothing, which:

  • normalises it to a clean 0–100 range,
  • makes it turn earlier than the raw MACD,
  • and produces far fewer whipsaws than a single stochastic.

 

The standard reading is oversold below 25 and overbought above 75. The useful signal is not the level itself but the turn: the STC crossing up through 25 (leaving oversold — a potential bottom) or down through 75 (leaving overbought — a potential top).

What the Screener Does

On every instrument it evaluates one event on the last closed bar:

  • STC crosses up through 25 → bottom / long signal,
  • STC crosses down through 75 → top / short signal.

 

Output columns:

  • STC — the oscillator value (0–100) on the last bar.
  • Senal — +1 for a bottom turn, −1 for a top turn. Sort by it to separate longs from shorts.
  • Cierre — closing price, for context.

Code

//----------------------------------------------
//PRC_Schaff Trend Cycle - Screener
//version = 1
//18.06.2026
//Ivan Gonzalez @ www.prorealcode.com
//Sharing ProRealTime knowledge
//----------------------------------------------

fastLength = 23
slowLength = 50
cycleLength = 10

mymacd = average[fastLength,1](close) - average[slowLength,1](close)

ll1 = lowest[cycleLength](mymacd)
rg1 = highest[cycleLength](mymacd) - ll1
k1 = (mymacd - ll1) / max(rg1, 0.000001) * 100

pf = average[3,1](k1)

ll2 = lowest[cycleLength](pf)
rg2 = highest[cycleLength](pf) - ll2
k2 = (pf - ll2) / max(rg2, 0.000001) * 100

stc = average[3,1](k2)

longSignal = stc crosses over 25
shortSignal = stc crosses under 75

signalDir = 0
if longSignal then
   signalDir = 1
endif
if shortSignal then
   signalDir = -1
endif

SCREENER[longSignal OR shortSignal](stc AS "STC", signalDir AS "Señal", close AS "Cierre")

Download
Filename: SCR_STC-Schaff-Trend-Cycle.itf
Downloads: 6
Iván González Legend
Developer by day, aspiring writer by night. Still compiling my bio... Error 404: presentation not found.
Author’s Profile

Comments

Logo Logo
Loading...