OPEN-SOURCE SCRIPT
Momentum Regime & Confluence Engine

Momentum Regime & Confluence Engine is a Stochastic RSI–based momentum framework designed to display live momentum state, higher-timeframe regime context, and an optional pattern-projection timing overlay in a single indicator pane.
This script is intended for momentum structure and regime context, not as an automated strategy. It does not place trades and does not guarantee outcomes.
What This Script Displays
1) Live Stochastic RSI (%K / %D) — Current Chart Timeframe
The script computes a standard Stoch RSI on the active chart timeframe:
RSI is calculated from price
A stochastic transform is applied to RSI
%K is smoothed
%D is a further smoothing of %K
Live %K and %D are plotted in the pane with standard overbought/oversold reference levels (80/20).
2) Weekly Regime Background (Full Pane Shading)
A weekly Stoch RSI series is calculated using higher-timeframe data (request.security() with no lookahead).
The script classifies the weekly environment into Bull / Bear with an optional Neutral state.
To reduce rapid flip-flopping near crossovers, the weekly regime uses a hysteresis model based on the signed percentage distance between weekly %K and %D:
Enter thresholds require stronger separation to switch regimes
Exit thresholds allow a smaller move to transition out
Optional Neutral zone treats a small band around zero as neutral
The weekly regime is displayed as full-pane background shading.
3) Daily Regime Overlay (Secondary Shading)
A daily Stoch RSI series is also sampled via request.security() (no lookahead) and classified into Bull / Bear with an optional Neutral state.
Daily regime shading is drawn as a lighter overlay on top of the weekly background to make daily-vs-weekly alignment visually apparent.
4) Weekly Context Tag (Optional)
An optional small table “W Context” tag can be displayed in a selectable corner.
It shows the current weekly regime state (Bull / Bear / Neutral) so higher-timeframe context remains visible even when focusing on live oscillator movement.
5) Forward Projection of a Historical Stoch RSI Pattern (Optional)
A projection feature can sample a historical Stoch RSI pattern (%K and %D) from a user-defined bars-back window and shift that pattern forward in time.
Optional normalization can rescale the sampled pattern to the recent observed range for visual comparability.
This projection is a pattern-visualization and timing-reference tool, not a prediction engine.
6) Projected Cross Markers (Optional)
When projection is enabled, the script can identify projected cross events inside the projected pattern:
vertical dotted timing markers in the pane
small arrows at the approximate projected cross level
an optional single “Projected Cross” balloon for the nearest upcoming projected cross
These markers are intended as timing reference points, not trade signals.
Alert System (Optional)
The script includes alert conditions for weekly and daily momentum events, including:
Confirmed bullish crosses (%K crossing above %D), optionally restricted to fully formed bars (daily/weekly close)
Imminent bullish cross conditions, based on proximity and slope behavior (approaching crossover logic)
Alignment alerts, where daily events can be filtered to trigger only when a bullish weekly context exists
Dual confirmed alerts when weekly and daily confirmed crosses occur together
Alerts report that a defined condition occurred; they do not imply trade execution or performance.
Chart Setup Notes
The projection feature samples historical data and plots forward graphics. For best accuracy, ensure the chart has fully loaded available history before interpreting projected timing markers.
On symbols or sessions with limited historical data, the sampled pattern window may be incomplete and can shift projected timing features.
Notes and Limitations
Regime shading is a momentum classification based on Stoch RSI relationships; it is not a guarantee of trend continuation or reversal.
Projection is a visual clone of a selected historical pattern and may not repeat.
Alerts indicate that configured conditions occurred; they are not buy/sell commands.
This script is provided for informational and educational purposes only and does not constitute financial advice.
This script is intended for momentum structure and regime context, not as an automated strategy. It does not place trades and does not guarantee outcomes.
What This Script Displays
1) Live Stochastic RSI (%K / %D) — Current Chart Timeframe
The script computes a standard Stoch RSI on the active chart timeframe:
RSI is calculated from price
A stochastic transform is applied to RSI
%K is smoothed
%D is a further smoothing of %K
Live %K and %D are plotted in the pane with standard overbought/oversold reference levels (80/20).
2) Weekly Regime Background (Full Pane Shading)
A weekly Stoch RSI series is calculated using higher-timeframe data (request.security() with no lookahead).
The script classifies the weekly environment into Bull / Bear with an optional Neutral state.
To reduce rapid flip-flopping near crossovers, the weekly regime uses a hysteresis model based on the signed percentage distance between weekly %K and %D:
Enter thresholds require stronger separation to switch regimes
Exit thresholds allow a smaller move to transition out
Optional Neutral zone treats a small band around zero as neutral
The weekly regime is displayed as full-pane background shading.
3) Daily Regime Overlay (Secondary Shading)
A daily Stoch RSI series is also sampled via request.security() (no lookahead) and classified into Bull / Bear with an optional Neutral state.
Daily regime shading is drawn as a lighter overlay on top of the weekly background to make daily-vs-weekly alignment visually apparent.
4) Weekly Context Tag (Optional)
An optional small table “W Context” tag can be displayed in a selectable corner.
It shows the current weekly regime state (Bull / Bear / Neutral) so higher-timeframe context remains visible even when focusing on live oscillator movement.
5) Forward Projection of a Historical Stoch RSI Pattern (Optional)
A projection feature can sample a historical Stoch RSI pattern (%K and %D) from a user-defined bars-back window and shift that pattern forward in time.
Optional normalization can rescale the sampled pattern to the recent observed range for visual comparability.
This projection is a pattern-visualization and timing-reference tool, not a prediction engine.
6) Projected Cross Markers (Optional)
When projection is enabled, the script can identify projected cross events inside the projected pattern:
vertical dotted timing markers in the pane
small arrows at the approximate projected cross level
an optional single “Projected Cross” balloon for the nearest upcoming projected cross
These markers are intended as timing reference points, not trade signals.
Alert System (Optional)
The script includes alert conditions for weekly and daily momentum events, including:
Confirmed bullish crosses (%K crossing above %D), optionally restricted to fully formed bars (daily/weekly close)
Imminent bullish cross conditions, based on proximity and slope behavior (approaching crossover logic)
Alignment alerts, where daily events can be filtered to trigger only when a bullish weekly context exists
Dual confirmed alerts when weekly and daily confirmed crosses occur together
Alerts report that a defined condition occurred; they do not imply trade execution or performance.
Chart Setup Notes
The projection feature samples historical data and plots forward graphics. For best accuracy, ensure the chart has fully loaded available history before interpreting projected timing markers.
On symbols or sessions with limited historical data, the sampled pattern window may be incomplete and can shift projected timing features.
Notes and Limitations
Regime shading is a momentum classification based on Stoch RSI relationships; it is not a guarantee of trend continuation or reversal.
Projection is a visual clone of a selected historical pattern and may not repeat.
Alerts indicate that configured conditions occurred; they are not buy/sell commands.
This script is provided for informational and educational purposes only and does not constitute financial advice.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.