OPEN-SOURCE SCRIPT
Telah dikemas kini Session Range Projections

Session Range Projections
Purpose & Concept:
Session Range Projections is a comprehensive trading tool that identifies and analyzes price ranges during user-defined time periods. The indicator visualizes high-probability reversal zones and profit targets by projecting Fibonacci levels from custom session ranges, making it ideal for traders who focus on time-based market structure analysis.
Key Features & Calculations:
1. Custom Time Range Analysis
- Define any time period for range calculation - from traditional sessions (Asian, London, NY) to custom periods like opening ranges, hourly ranges, or 4-hour blocks
- Automatically captures the highest and lowest prices within your specified timeframe
- Supports multiple timezone selections for global market analysis
- Flexible enough for intraday scalping ranges or longer-term swing trading setups
2. Premium & Discount Zones
- Automatically divides the range into premium (above 50%) and discount (below 50%) zones
- Visual differentiation helps identify institutional buying and selling areas
- Color-coded boxes clearly mark these critical price zones
3. Optimal Trade Entry (OTE) Zones
- Highlights the 79-89% retracement zone in premium territory
- Highlights the 11-21% retracement zone in discount territory
- These zones represent high-probability reversal areas based on institutional order flow concepts
4. Fibonacci Projections
- Projects 11 customizable Fibonacci extension levels from the range extremes
- Levels extend both above and below the range for symmetrical analysis
- Each level can be individually toggled and color-customized
- Default levels include common retracement ratios: -0.5, -1.0, -2.0, -2.33, -2.5, -3.0, -4.0, -4.5, -6.0, -7.0, -8.0
How to Use:
Set Your Time Range: Input your desired session start and end times (24-hour format)
Select Timezone: Choose the appropriate timezone for your trading session
Customize Display: Toggle various visual elements based on your preferences
Monitor Price Action: Watch for reactions at projected levels and OTE zones
Set Alerts: Configure sweep alerts for when price breaks above/below range extremes
Input Parameters Explained:
Time Range Settings
Range Start/End Hour & Minute: Define your analysis period
Time Zone: Ensure accurate session timing across different markets
Visual Settings
Range Box: Toggle the premium/discount zone visualization
Horizontal Lines: Customize high/low line appearance
Internal Range Levels: Show/hide equilibrium and OTE zones
Labels: Configure text display for key levels
Fibonacci Projections: Enable/disable extension levels
Display Settings
Historical Ranges: Show up to 10 previous session ranges
Alert Type: Choose between high sweep, low sweep, or both
Trading Applications:
Session-Based Trading: Analyze specific market sessions (Asian, London, New York, opening ranges, hourly ranges)
Reversal Trading: Identify high-probability reversal zones at OTE levels
Breakout/Reversal Trading: Monitor range breaks/reversals with built-in sweep alerts
Risk Management: Use Fibonacci projections as profit targets or rejection areas
Multi-Timeframe Analysis: Apply to any timeframe for various trading styles
Important Notes:
This indicator is for educational purposes only and should not be considered financial advice
Past performance does not guarantee future results
Always use proper risk management when trading
The indicator automatically manages historical data to maintain chart performance
Purpose & Concept:
Session Range Projections is a comprehensive trading tool that identifies and analyzes price ranges during user-defined time periods. The indicator visualizes high-probability reversal zones and profit targets by projecting Fibonacci levels from custom session ranges, making it ideal for traders who focus on time-based market structure analysis.
Key Features & Calculations:
1. Custom Time Range Analysis
- Define any time period for range calculation - from traditional sessions (Asian, London, NY) to custom periods like opening ranges, hourly ranges, or 4-hour blocks
- Automatically captures the highest and lowest prices within your specified timeframe
- Supports multiple timezone selections for global market analysis
- Flexible enough for intraday scalping ranges or longer-term swing trading setups
2. Premium & Discount Zones
- Automatically divides the range into premium (above 50%) and discount (below 50%) zones
- Visual differentiation helps identify institutional buying and selling areas
- Color-coded boxes clearly mark these critical price zones
3. Optimal Trade Entry (OTE) Zones
- Highlights the 79-89% retracement zone in premium territory
- Highlights the 11-21% retracement zone in discount territory
- These zones represent high-probability reversal areas based on institutional order flow concepts
4. Fibonacci Projections
- Projects 11 customizable Fibonacci extension levels from the range extremes
- Levels extend both above and below the range for symmetrical analysis
- Each level can be individually toggled and color-customized
- Default levels include common retracement ratios: -0.5, -1.0, -2.0, -2.33, -2.5, -3.0, -4.0, -4.5, -6.0, -7.0, -8.0
How to Use:
Set Your Time Range: Input your desired session start and end times (24-hour format)
Select Timezone: Choose the appropriate timezone for your trading session
Customize Display: Toggle various visual elements based on your preferences
Monitor Price Action: Watch for reactions at projected levels and OTE zones
Set Alerts: Configure sweep alerts for when price breaks above/below range extremes
Input Parameters Explained:
Time Range Settings
Range Start/End Hour & Minute: Define your analysis period
Time Zone: Ensure accurate session timing across different markets
Visual Settings
Range Box: Toggle the premium/discount zone visualization
Horizontal Lines: Customize high/low line appearance
Internal Range Levels: Show/hide equilibrium and OTE zones
Labels: Configure text display for key levels
Fibonacci Projections: Enable/disable extension levels
Display Settings
Historical Ranges: Show up to 10 previous session ranges
Alert Type: Choose between high sweep, low sweep, or both
Trading Applications:
Session-Based Trading: Analyze specific market sessions (Asian, London, New York, opening ranges, hourly ranges)
Reversal Trading: Identify high-probability reversal zones at OTE levels
Breakout/Reversal Trading: Monitor range breaks/reversals with built-in sweep alerts
Risk Management: Use Fibonacci projections as profit targets or rejection areas
Multi-Timeframe Analysis: Apply to any timeframe for various trading styles
Important Notes:
This indicator is for educational purposes only and should not be considered financial advice
Past performance does not guarantee future results
Always use proper risk management when trading
The indicator automatically manages historical data to maintain chart performance
Nota Keluaran
Fixed the “midnight bug” – the range now plots correctly even when the session starts in the evening (e.g. 11 PM) and ends after midnight (e.g. 1 AM)No changes to inputs or visuals apart from the bug fix – your existing settings and thumbnail stay the same
Nota Keluaran
Fixed Following Bugs:1. Resolved the primary bug where projection lines, internal lines and boxes, and Fibonacci levels would disappear in real-time immediately after the session range was completed.
2. Corrected an issue where an incomplete session from a day with an early market close could interfere with the next day's calculations.
3. Corrected week day logic for futures markets (Sunday - Friday)
Nota Keluaran
Fixed bug to allow the indicator to work during weekends for crypto marketsNota Keluaran
Major Update:--Major Feature Additions--
- Session Presets System: Added predefined sessions (Asia, London, NY AM, NY PM) and higher timeframe options (Previous 15m, 1hr, 2hr, 4hr, Day, Week, Month) replacing manual time input only
- Fair Value Gap (FVG) Detection: New feature to identify and display the first presented FVG after range completion with customizable box, midline, and label
- OTE Zone Alerts: Added alerts for when price enters Premium or Discount OTE zones, not just high/low sweeps
- Separate OTE Box Colors: Premium and Discount OTE boxes now have independent color controls instead of sharing one color
- FVG Historical Lookback: Separate lookback setting specifically for FVG display, allowing FVGs to persist longer than other range elements
Visual Improvements:
- Enhanced Color Customization:
- Separate colors for Premium OTE Box vs Discount OTE Box
- Separate colors for Premium OTE Label vs Discount OTE Label
- FVG box, midline, and label have independent color settings
- Better Organization: Settings grouped more logically with clearer group names and inline options for related settings
- FVG Display Options:
- Customizable FVG box opacity
- FVG midline style (solid/dotted/dashed)
- FVG label position (middle/right)
- FVG label size control
Technical Improvements:
- Smart Line Extension Logic: Lines now extend to the next session start time instead of arbitrary bar counts, making displays cleaner and more predictable
- Higher Timeframe Support: Complete implementation for displaying previous HTF bar ranges with proper lookahead
- Improved Session Cleanup: Better memory management with trimmed sessions keeping only FVGs when outside main lookback period
- Preset Change Handling: Clears all drawings when switching between presets to prevent visual conflicts
Bug Fixes:
- Fixed Missing High/Low Lines: Corrected issue where high/low lines weren't being created when session completed
- Proper Session Storage: Adjusted code, preventing recalculation issues
- Enhanced Day Transition: Improved handling of new trading day detection to properly close incomplete sessions
- Color Field Improvements: Fixed deprecated color transparency syntax throughout the code
User Experience Updates:
- Tooltip Additions: Added helpful tooltips to input fields explaining their purpose
- Alert Type Expansion: Added "None" option to sweep alerts and new OTE alert types
- Smart Defaults: Premium zones now use red tones while discount zones use blue/cyan tones for intuitive visual distinction
Nota Keluaran
Updates:- Added alerts for fib levels
- Added setting to turn internal range levels on/off
- High/Low labels now change to show the preset its on and allows an abbreviation setting to allow the user to use H/L or High/Low depending on their preference
- Option to extend drawings of current range to either extend to the next session or extend only to current bar
- Added range box border options
- Added customizable thickness for fib levels
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.