OPEN-SOURCE SCRIPT
Stoch RSI Golden Cross | Astral Vision

Stoch RSI Golden Cross | Astral Vision 🌠💠
This indicator applies a Stochastic RSI computed on a fixed 5-day timeframe, using deliberately long lookback periods that filter out short-term noise and produce a slowly-turning oscillator oriented toward identifying major cycle inflection points rather than frequent trading signals. Crossovers between the K and D lines are only considered valid when they occur within the oversold or overbought zones, ensuring that signals correspond to genuine momentum reversals from extreme positioning rather than midrange noise crosses.
Calculation ⚙️
The RSI is computed over 121 periods on the 5-day timeframe. The Stochastic of that RSI is then computed over 144 periods, measuring where the current RSI value sits within its highest-to-lowest range over the past 144 bars. This raw Stochastic is smoothed with a 33-period simple moving average to produce the K line. A second 25-period simple moving average is then applied to K to produce the D signal line.
The use of a 5-day timeframe with these long periods means each bar represents one trading week, and the full K lookback of 144 bars covers approximately 2.75 years of weekly data. This makes the oscillator insensitive to anything shorter than multi-month momentum shifts, functioning as a macro cycle tool rather than a swing trading indicator.
A bullish golden cross signal fires when K crosses above D while both lines are below the oversold threshold (default 10), meaning the crossover occurs from a position of statistically extreme pessimism. A bearish cross signal fires when K crosses below D while both lines are above the overbought threshold (default 80), meaning the crossover occurs from a position of statistically extreme optimism. Crosses that occur in the neutral zone between the two thresholds are ignored entirely.
Each valid signal draws a vertical line with a four-layer glow effect on the price chart, marking the exact bar at which the signal occurred and extending across the full chart height for maximum visibility.
Plots 📊
Inputs 🎛️
Colors 🎨
5 Astral Vision presets + custom override. Default: Inferno.
Purpose 🎯
A standard Stochastic RSI with default parameters (14/14/3/3) generates dozens of signals per year, most of which are noise on a macro timeframe. This implementation uses a 5-day bar combined with extended lookback periods to reduce the signal count to a handful per multi-year cycle, corresponding only to the deepest oversold recoveries and most extreme overbought reversals. The zone filter adds a second condition that eliminates all midrange crosses, further concentrating the signal set on statistically meaningful structural turning points. The result is an indicator designed to fire rarely and only at potentially significant macro inflection points rather than as a continuous trading signal generator.
Disclaimer ⭕️
This indicator is for informational and educational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always do your own research before making investment decisions.
This indicator applies a Stochastic RSI computed on a fixed 5-day timeframe, using deliberately long lookback periods that filter out short-term noise and produce a slowly-turning oscillator oriented toward identifying major cycle inflection points rather than frequent trading signals. Crossovers between the K and D lines are only considered valid when they occur within the oversold or overbought zones, ensuring that signals correspond to genuine momentum reversals from extreme positioning rather than midrange noise crosses.
Calculation ⚙️
The RSI is computed over 121 periods on the 5-day timeframe. The Stochastic of that RSI is then computed over 144 periods, measuring where the current RSI value sits within its highest-to-lowest range over the past 144 bars. This raw Stochastic is smoothed with a 33-period simple moving average to produce the K line. A second 25-period simple moving average is then applied to K to produce the D signal line.
The use of a 5-day timeframe with these long periods means each bar represents one trading week, and the full K lookback of 144 bars covers approximately 2.75 years of weekly data. This makes the oscillator insensitive to anything shorter than multi-month momentum shifts, functioning as a macro cycle tool rather than a swing trading indicator.
A bullish golden cross signal fires when K crosses above D while both lines are below the oversold threshold (default 10), meaning the crossover occurs from a position of statistically extreme pessimism. A bearish cross signal fires when K crosses below D while both lines are above the overbought threshold (default 80), meaning the crossover occurs from a position of statistically extreme optimism. Crosses that occur in the neutral zone between the two thresholds are ignored entirely.
Each valid signal draws a vertical line with a four-layer glow effect on the price chart, marking the exact bar at which the signal occurred and extending across the full chart height for maximum visibility.
Plots 📊
- K line in the sub-panel
- D signal line in the sub-panel
- Oversold threshold line at 10
- Overbought threshold line at 80
- Glow vertical lines on the price chart at each valid bullish cross
- Glow vertical lines on the price chart at each valid bearish cross (toggleable)
Inputs 🎛️
- Show Only Bullish Golden Cross: toggle to hide bearish cross signals and show only bullish ones
Colors 🎨
5 Astral Vision presets + custom override. Default: Inferno.
Purpose 🎯
A standard Stochastic RSI with default parameters (14/14/3/3) generates dozens of signals per year, most of which are noise on a macro timeframe. This implementation uses a 5-day bar combined with extended lookback periods to reduce the signal count to a handful per multi-year cycle, corresponding only to the deepest oversold recoveries and most extreme overbought reversals. The zone filter adds a second condition that eliminates all midrange crosses, further concentrating the signal set on statistically meaningful structural turning points. The result is an indicator designed to fire rarely and only at potentially significant macro inflection points rather than as a continuous trading signal generator.
Disclaimer ⭕️
This indicator is for informational and educational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always do your own research before making investment decisions.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
My premium indicators are available on Whop:
whop.com/astralvision
Astral Vision 🌠💠
whop.com/astralvision
Astral Vision 🌠💠
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
My premium indicators are available on Whop:
whop.com/astralvision
Astral Vision 🌠💠
whop.com/astralvision
Astral Vision 🌠💠
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.