1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
56 lines of Pine Script v4 from oscillators/stc_schaff_trend_cycle.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.
Schaff Trend Cycle subtracts a slow exponential moving average from a fast one, applies a stochastic cycle twice, and smooths each result to form a 0–100 oscillator. Line color follows the slope, or the upper and lower bands when breakout highlighting is on. Circles mark a cross above the lower band and a cross below the upper band, and alerts fire on those and other band crosses. Lengths, source, and band levels are adjustable. It is an indicator only and does not manage trades.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
MACD Fast Length
int
23
fastLength
MACD Slow Length
int
50
slowLength
Cycle Length
int
10
cycleLength
1st %D Length
int
3
d1Length
2nd %D Length
int
3
d2Length
Source
source
close
src
Upper Band
int
75
upper
Lower Band
int
25
lower
Highlight Breakouts ?
bool
true
highlightBreakouts
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
Calculates multi-timeframe Moving Average Convergence Divergence (MACD) alongside a Money Flow filter to identify potential market breakouts. It evaluates higher-timeframe MACD calculations using exponential or simple moving averages combined with Money Flow o
Target Radar is a multi-factor forecasting indicator that plots projection bands, forward boxes, and dynamic target zones directly on the main price chart. It calculates a forecast score by combining z-scores for trend, momentum, volume pressure, and volatilit
This indicator identifies trend-following breakout opportunities by combining directional movement, trend channels, and multi-period price extremes. It calculates an ADX-colored weighted moving average, a linear regression trend filter based on a volatility ch
This indicator calculates a modified MACD oscillator and signal line alongside a trend EMA filter, plotting the output as a stylized column histogram in a separate pane. Instead of plotting true MACD distance, it quantifies positive and negative histogram mome
This indicator plots the Average Directional Index in a separate pane and colors the line teal or maroon according to whether plus DI is above minus DI. A horizontal key level and a silver background mark periods when ADX exceeds that threshold. With labels en
Standardized Trend Map calculates series momentum relative to active price range across 40 distinct lookback periods ranging from 2 to 80 bars on an exponential moving average source. Each standardized calculation rounds to an integer values of -1, 0, or 1 to