PROTECTED SOURCE SCRIPT
STC Hedge Continuity

STC Hedge v8 is a signal-only indicator that combines a custom Schaff Trend Cycle (STC) with a higher-timeframe (HTF) EMA trend gate, an optional EMA slope filter, and an ADX-based auto-toggle that relaxes slope gating during strong trends.
How it works:
1) Custom Schaff Trend Cycle (STC)
Built from a normalized MACD-like EMA difference (EMA(fast) – EMA(slow)), scaled into 0–100, and smoothed. Detects cyclical overbought/oversold shifts more responsively than RSI or MACD.
2) HTF EMA Trend Gate
Two EMAs (fastLength, slowLength) computed on a higher timeframe (gateTF). Bull gate: EMA(fast) > EMA(slow) for at least trendBars.
Bear gate: EMA(fast) < EMA(slow) for at least trendBars. Adds directional persistence to avoid whipsaws.
3) EMA Slope Filter (optional)
Confirms both EMAs are trending upward (longs) or downward (shorts) over slopeLookback bars.
Can compute slope on HTF (gateTF) for smoother signals.
ADX Auto-Toggle: slope filter is automatically bypassed when ADX ≥ adxThresh, letting strong trends flow without over-filtering.
4) ADX Calculation (self-contained)
Custom implementation of DI/ADX (no ta.adx dependency). Runs either on the trend gate TF or a user-defined adxTF.
5) Signal Triggers
Long: STC crosses above lowerThresh + bull gate + slope check + cooldown satisfied.
Short: STC crosses below upperThresh + bear gate + slope check + cooldown satisfied.
Green triangles = long signals; red triangles = short signals.
How it works:
1) Custom Schaff Trend Cycle (STC)
Built from a normalized MACD-like EMA difference (EMA(fast) – EMA(slow)), scaled into 0–100, and smoothed. Detects cyclical overbought/oversold shifts more responsively than RSI or MACD.
2) HTF EMA Trend Gate
Two EMAs (fastLength, slowLength) computed on a higher timeframe (gateTF). Bull gate: EMA(fast) > EMA(slow) for at least trendBars.
Bear gate: EMA(fast) < EMA(slow) for at least trendBars. Adds directional persistence to avoid whipsaws.
3) EMA Slope Filter (optional)
Confirms both EMAs are trending upward (longs) or downward (shorts) over slopeLookback bars.
Can compute slope on HTF (gateTF) for smoother signals.
ADX Auto-Toggle: slope filter is automatically bypassed when ADX ≥ adxThresh, letting strong trends flow without over-filtering.
4) ADX Calculation (self-contained)
Custom implementation of DI/ADX (no ta.adx dependency). Runs either on the trend gate TF or a user-defined adxTF.
5) Signal Triggers
Long: STC crosses above lowerThresh + bull gate + slope check + cooldown satisfied.
Short: STC crosses below upperThresh + bear gate + slope check + cooldown satisfied.
Green triangles = long signals; red triangles = short signals.
סקריפט מוגן
סקריפט זה פורסם כמקור סגור. עם זאת, אתה יכול להשתמש בו באופן חופשי וללא כל הגבלה - למד עוד כאן.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
סקריפט מוגן
סקריפט זה פורסם כמקור סגור. עם זאת, אתה יכול להשתמש בו באופן חופשי וללא כל הגבלה - למד עוד כאן.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.