15-Min RSI Scalper [SwissAlgo]15-Min RSI Scalper  
 Tracks RSI Momentum Loss and Gain to Generate Signals 
-------------------------------------------------------
 WHAT THIS INDICATOR CALCULATES 
This indicator attempts to identify  RSI directional changes   (RSI momentum) using a step-by-step "ladder" method. It reads RSI(14) from the next higher timeframe relative to your chart. On a 15-minute chart, it uses 1-hour RSI. On a 5-minute chart, it uses 15-minute RSI, and so on.
 How the ladder logic works: 
The indicator doesn't track RSI all the time. It only starts tracking when RSI crosses into potentially extreme territory (these are called "events" in the code):
 
 For sell signals : when RSI crosses above a dynamic upper threshold (typically between 60-80, calculated as the 90th percentile of recent RSI)
 For buy signals : when RSI crosses below a dynamic lower threshold (typically between 20-40, calculated as the 10th percentile of recent RSI)
 
Once tracking begins, RSI movement is divided into 2-point steps (boxes). The indicator counts how many boxes RSI climbs or falls.
A signal generates only when:
 
 RSI reverses direction by at least 2 boxes (4 RSI points) from its extreme
 RSI holds that reversal for 3 consecutive confirmed bars
 
 Example:  Dynamic threshold is at 68. RSI crosses above 68 → tracking starts. RSI climbs to 76 (4 boxes up). Then it drops back to 72 and stays below that level for 3 bars → sell signal prints. The buy signal works the same way in reverse.
-------------------------------------------------------
 SIGNAL GENERATION METHODOLOGY 
 Sell Signal (Red Triangle) 
 
 RSI crosses above a dynamic start level (calculated as the 90th percentile of the last 1000 bars, constrained between 60-80)
 Indicator tracks upward progression in 2-point boxes
 RSI reverses and drops below a boundary 2 boxes below the highest box reached
 RSI remains below that boundary for 3 confirmed bars
 Red triangle plots above price
 
Reset condition: RSI returns below 50
 Buy Signal (Green Triangle) 
 
 RSI crosses below a dynamic start level (10th percentile of last 1000 bars, constrained between 20-40)
 Indicator tracks downward progression in 2-point boxes
 RSI reverses and rises above a boundary 2 boxes above the lowest box reached
 RSI remains above that boundary for 3 confirmed bars
 Green triangle plots below price
 
Reset condition: RSI returns above 50
-------------------------------------------------------
 TECHNICAL PARAMETERS 
All parameters are hardcoded:
 
 RSI Period: 14
 Box Size: 2 RSI points
 Reversal Threshold: 2 boxes (4 RSI points)
 Confirmation Period: 3 bars
 Reset Level: RSI 50
 Sell Start Range: 60-80 (dynamic)
 Buy Start Range: 20-40 (dynamic)
 Lookback for Percentile: 1000 bars
 
 Note:  Since the code is open source, users can modify these hardcoded values directly in the script to adjust sensitivity. For example, increasing the confirmation period from 3 to 5 bars will produce fewer but more conservative signals. Decreasing the box size from 2 to 1 will make the indicator more responsive to smaller RSI movements.
-------------------------------------------------------
 KEY FEATURES 
 Automatic Higher Timeframe RSI 
When applied to a 15-minute chart, the indicator automatically reads 1-hour RSI data. This is the next standard timeframe above 15 minutes in the indicator's logic.
 Dynamic Adaptive Start Levels 
Sell signals use the 90th percentile of RSI over the last 1000 bars, constrained between 60-80. Buy signals use the 10th percentile, constrained between 20-40. These thresholds recalculate on each bar based on recent data.
 Ladder Box System 
RSI movements are tracked in 2-point boxes. The indicator requires a 2-box reversal followed by 3 consecutive bars maintaining that reversal before generating a signal.
 Dual Signal Output 
Red down-triangles plot above price when the sell signal conditions are met. Green up-triangles plot below the price when buy signal conditions are met.
-------------------------------------------------------
 REPAINTING 
This indicator does not repaint. All calculations use "barstate.isconfirmed" to ensure signals appear only on closed bars. The request.security() call uses lookahead=barmerge.lookahead_off to prevent forward-looking bias.
-------------------------------------------------------
 INTENDED CHART TIMEFRAME 
This indicator is designed for use on 15-minute charts. The visual reminder table at the top of the chart indicates this requirement.
On a 15-minute chart:
 
 RSI data comes from the 1-hour timeframe
 Signals reflect 1-hour momentum shifts
 3-bar confirmation equals 45 minutes of price action
 
Using it on other timeframes will change the higher timeframe RSI source and may produce different behavior.
-------------------------------------------------------
 WHAT THIS INDICATOR DOES NOT DO 
 
 Does not predict future price movements
 Does not provide entry or exit advice
 Does not guarantee profitable trades
 Does not replace comprehensive technical analysis
 Does not account for fundamental factors, news events, or market structure
 Does not adapt to all market conditions equally
 
-------------------------------------------------------
 EDUCATIONAL USE 
This indicator demonstrates one approach to momentum reversal detection using:
 
 Multi-timeframe analysis
 Adaptive thresholds via percentile calculation
 Step-wise momentum tracking
 Multi-bar confirmation logic
 
It is designed as a technical study, not a trading system. Signals represent calculated conditions based on RSI behavior, not trade recommendations. Always do your own analysis before taking market positions.
-------------------------------------------------------
 RISK DISCLOSURE 
Trading involves substantial risk of loss. This indicator:
 
 Is for educational and informational purposes only
 Does not constitute financial, investment, or trading advice
 Should not be used as the sole basis for trading decisions
 Has not been tested across all market conditions
 May produce false signals, late signals, or no signals in certain conditions
 
Past performance of any indicator does not predict future results. Users must conduct their own analysis and risk assessment before making trading decisions. Always use proper risk management, including stop losses and position sizing appropriate to your account and risk tolerance.
 MIT LICENSE 
This code is open source and provided as-is without warranties of any kind. You may use, modify, and distribute it freely under the MIT License.
