OPEN-SOURCE SCRIPT
NQ Statistical Mapper

NQ Statistical Mapper
CRITICAL DISCLAIMER - READ FIRST
WARNING: THIS INDICATOR IS EXCLUSIVELY FOR NQ (NASDAQ-100 E-MINI FUTURES) ONLY
All statistics displayed in this indicator are HARD-CODED values derived from a comprehensive analysis of 12 years (2013-2025) of 1-minute NQ futures data. These statistics are calculated offline using Python and embedded directly into the indicator code.
These probabilities DO NOT apply to any instrument other than NQ
What This Indicator Does
The NQ Statistical Mapper is a data-driven trading tool that displays historical probability statistics for intraday NQ price behavior based on overnight session structure and opening positioning. Rather than generating signals, it provides context by showing:
Three trading sessions with visual boxes: Asia (8PM-2AM), London (2AM-8AM), and New York (8AM-4PM) Eastern Time
Key price levels with historical hit rate percentages showing the probability these levels are touched during the NY cash session (8AM-4PM)
Context-aware statistics that change based on current market conditions
Session range analysis showing whether Asia and London ranges are unusually large or small compared to recent history
Core Methodology and Statistical Foundation
Pattern Detection System
The indicator automatically detects one of four overnight session patterns based on how the London session (2AM-8AM) interacts with the Asia session (8PM-2AM):
London Engulfs Asia: London high is greater than Asia high AND London low is less than Asia low
Asia Engulfs London: Asia high is greater than or equal to London high AND Asia low is less than or equal to London low
London Partial Up: London high is greater than Asia high BUT London low is greater than or equal to Asia low (took out Asia high only)
London Partial Down: London low is less than Asia low BUT London high is less than or equal to Asia high (took out Asia low only)
Each pattern has distinct statistical characteristics that influence NY session behavior.
Conditional Probability Framework
The indicator uses a conditional probability approach where statistics adapt based on:
Primary Condition: Where does NY open (8:00 AM) relative to the London session midpoint?
"NY opens above London midpoint"
"NY opens below London midpoint"
This single condition dramatically changes the probabilities. For example:
When NY opens above London midpoint: 76.68% chance NY hits the London high before the London low during 8AM-4PM
When NY opens below London midpoint: 73.32% chance NY hits the London low before the London high during 8AM-4PM
Secondary Condition: The overnight pattern further refines these probabilities. Each combination of "NY position vs London midpoint" plus "overnight pattern" has unique hit rate statistics calculated from the 12-year dataset.
"Hit First" Statistics Explained
The table displays "Hit High First" and "Hit Low First" percentages. These answer the question: "During the NY cash session (8AM-4PM), if price eventually touches both the London high AND London low, which one does it touch FIRST?"
Example interpretation:
Hit High First: 76.68% means that in 76.68% of historical days with this setup, price touched the London high before touching the London low
Hit Low First: 22.48% means London low was touched first
The remaining approximately 1% represents days where neither level was hit during the NY session
This is fundamentally different from asking "will price go up or down" - it is about the sequence of range expansion during the NY session.
Displayed Levels and Their Meanings
Session Highs/Lows (Solid Lines)
These appear when each session completes and extend through the NY session:
Asia High/Low (Orange): The highest and lowest prices during 8PM-2AM EST
London High/Low (Blue): The highest and lowest prices during 2AM-8AM EST
Each level shows its hit rate percentage - the probability that NY session price (8AM-4PM) will touch that level, based on the current pattern and NY opening position.
Hourly Midpoint Levels (Dashed Gray Lines)
Three specific hourly levels with remarkably high hit rates:
7-8 AM Midpoint: Average of high and low during the 7-8 AM hour. Hit rates consistently above 93-94%, essentially sitting at the 8 AM open price (mean distance: -0.001%)
Midnight Open: The opening price at midnight EST. Hit rates vary from 62-87% depending on pattern and setup
2-3 AM Midpoint: Average of high and low during the 2-3 AM hour. Hit rates range from 67-92%
These levels are derived from mean-reversion behavior - price tends to revisit certain overnight reference points during the NY session.
Session Midpoints (Dotted Lines)
Optional display of Asia and London session midpoints. These lines terminate when their respective sessions end, providing additional reference levels for session positioning.
Statistics Table Breakdown
The table displays five sections of information:
1. SETUP Section
Shows whether "NY opens above/below London midpoint"
Displays the detected overnight pattern (1 of 4 types)
Sample size: Number of historical days matching this exact setup
Hit High First / Hit Low First: Directional bias percentages
2. HIT RATES (8AM-4PM) Section
Shows probability that each level gets touched at any point during the NY cash session:
7-8 AM Midpoint: Almost always touched (93-97% depending on pattern)
Midnight Open: Varies significantly (62-87%) based on whether the overnight pattern is aligned or contrary to NY's opening position
2-3 AM Midpoint: Strong hit rates (67-92%)
These are independent probabilities - they do not predict which is hit first, just whether each level gets visited.
3. ASIA RANGE Section
Real-time comparison of today's Asia session range versus recent history:
Sessions Captured: Shows how many sessions are in the rolling calculation (e.g., "18 / 50" = 18 sessions captured out of 50 requested). This alerts users if their chart history is insufficient
Current Range: Today's Asia high minus Asia low in points
Mean Range: Average range over the captured sessions
Percentile Rank: Where today's range falls in the distribution
80th percentile (red background): Unusually large range - top 20% of days
60-80th percentile (light gray): Above average
20-60th percentile (white): Normal range
Less than 20th percentile (light blue): Unusually small range - bottom 20% of days
4. LONDON RANGE Section
Identical structure to Asia Range section, analyzing the London session's range characteristics.
Why Percentile Rank Instead of Standard Deviation?
Intraday ranges exhibit right-skewed distributions with fat tails (volatility spikes create extreme outliers). Percentile rank is distribution-free and robust to these characteristics, providing more reliable identification of unusual ranges than z-scores or standard deviations.
How To Use This Indicator
For Context and Confluence
This is not a standalone trading system. The indicator provides statistical context to support other analysis:
Understanding Session Bias: If the table shows 76% probability of hitting the session high first, you know there is a statistical lean toward upside range expansion
Target Setting: If trading a breakout above the overnight high, knowing that Asia high gets hit 75% of the time helps assess target viability
Entry Timing: The 7-8 AM midpoint's 94% hit rate makes it an excellent re-entry or scaling level
Range Expansion Assessment: Percentile rankings help identify whether overnight sessions showed abnormal volatility, which may influence NY session behavior
Pattern-Specific Insights
London Partial Up plus NY Opens Below London Midpoint:
Midnight open hit rate jumps to 87.82% (strong mean reversion)
Suggests counter-trend reversal back toward overnight lows is likely
London Partial Down plus NY Opens Above London Midpoint:
Midnight open hit rate is 86.30%
Mirror pattern - reversion toward overnight highs
Asia Engulfs London Pattern:
Very high hit rates (85-98%) across all levels
Suggests consolidation/mean reversion during NY session rather than directional expansion
Typical Workflow
8:00 AM: Review the statistics table - which pattern occurred? Where did NY open relative to London midpoint?
Check Hit Rates: Note which levels have the highest probabilities of being touched
Assess Range Percentiles: Are Asia/London ranges unusually large or small? High percentiles may indicate already-extended ranges
Combine With Your Strategy: Use the statistics as confluence with your technical analysis, support/resistance, or order flow
Customization Options
Trading Sessions Settings
Session Visualization:
Toggle each session on/off independently
Customize colors for each session (New York, London, Asia)
Adjust background transparency using "Range Area Transparency" slider (0-100, default 90)
Show/hide session outlines with "Range Outline" checkbox
Each session has three customizable parameters on the same line:
Checkbox to enable/disable the session
Text field to rename the session label if desired
Color picker to select the session's display color
Hit Rate Levels Settings
Master Controls:
"Show Hit Rate Levels" - Master toggle to show or hide all level lines and labels
Individual Level Toggles:
"7-8 AM Midpoint" - Toggle the 7-8 AM hour midpoint level
"Midnight Open" - Toggle the midnight opening price level
"2-3 AM Midpoint" - Toggle the 2-3 AM hour midpoint level
Hourly Level Styling (applies to 7-8 AM Mid, Midnight, and 2-3 AM Mid):
"Hourly Level Color" - Color picker for all three hourly levels
"Hourly Level Line Width" - Thickness of hourly level lines (1-5, default 1)
"Hourly Level Line Style" - Choose between Solid, Dashed, or Dotted lines (default Dashed)
Session High/Low Styling (applies to Asia High/Low and London High/Low):
"Session High/Low Line Width" - Thickness of session extreme lines (1-5, default 1)
"Session High/Low Line Style" - Choose between Solid, Dashed, or Dotted lines (default Solid)
Additional Options:
"Show Session Midpoints" - Toggle display of Asia and London midpoint reference lines (dotted lines that end when each session completes)
"Label Text Size" - Size of percentage labels on all levels (tiny, small, normal, large, default small)
Table Settings
Statistics Table Controls:
"Show Statistics Table" - Master toggle to display or hide the entire statistics table
"Stats Table Position" - Choose from 9 positions on the chart:
Top: Top Left, Top Center, Top Right
Middle: Middle Left, Middle Center, Middle Right
Bottom: Bottom Left, Bottom Center, Bottom Right
"Stats Table Size" - Text size within the table (Auto, Tiny, Small, Normal, Large, Huge, default Small)
"Sessions for Stats Calculation" - Number of historical sessions to use for percentile calculations (5-100, default 50)
Lower values (20-30): More responsive to recent market conditions
Higher values (50-100): More stable baseline, requires more chart history
The table displays "Sessions Captured" to show how many sessions were actually available
Important Limitations and Considerations
1. This Is Historical Data, Not Prediction
The statistics show what happened in the past given similar setups. Markets evolve, regimes change, and past probability does not guarantee future outcomes. A 75% hit rate means that in 25% of historical cases, the level was NOT hit.
2. Chart History Requirements
TradingView imposes data limits:
5-minute chart: Approximately 10 days of history (enough for minimal statistics)
1-minute chart: Approximately 2-3 days of history (insufficient for percentile calculations)
Use 5-minute or higher timeframes to ensure adequate session capture
The table displays "Sessions Captured" (e.g., 18/50) to alert you when your chart history is limited.
3. Session Timing Is Fixed (EST)
All sessions use America/New_York timezone:
Asia: 8PM-2AM
London: 2AM-8AM
NY: 8AM-4PM
These times do not adjust for daylight saving changes in other regions. The definitions match CME NQ futures trading hours.
4. The Statistics Are From 2013-2025 Data
The 12-year analysis period includes:
Multiple market regimes (bull/bear/sideways)
Various volatility environments
QE, taper tantrums, COVID, 2022 bear market, 2023-2024 rally
However, it is still a limited sample. Future market structure changes (algorithmic trading evolution, regulatory changes, etc.) may alter these probabilities over time.
5. No Real-Time Calculation
This indicator does not recalculate statistics based on your chart's data. It displays pre-calculated probabilities. The only real-time calculations are:
Which pattern occurred today
Where NY opened relative to London midpoint
Current session ranges and their percentile ranks (based on your chart's recent history)
Statistical Methodology Details
Data Source
Instrument: NQ (Nasdaq-100 E-mini Futures) continuous contract
Timeframe: 1-minute bars
Period: January 2013 - January 2025 (12 years)
Sample Size: 3,132 trading days analyzed
Analysis Approach
Each trading day was classified by overnight pattern (4 types). NY opening position vs London midpoint was determined. For each combination (4 patterns times 2 positions equals 8 scenarios), the following was measured:
How often each level (session highs/lows, hourly midpoints) was touched during 8AM-4PM
Which session extreme (high or low) was hit first
Mean distance from 8 AM open to each level
Session ranges were measured for percentile analysis. All percentages were rounded to two decimal places for display.
Why These Specific Levels?
The levels were not chosen arbitrarily:
Session highs/lows: Natural support/resistance from overnight price discovery
7-8 AM midpoint: The final hour before NY open often establishes the opening range balance point
Midnight open: Represents the "true" start of the trading day (6PM-5PM structure)
2-3 AM midpoint: Captures early London price action balance
Testing showed these levels had the highest and most consistent hit rates across different patterns and setups.
Technical Implementation Notes
Language: Pine Script v5
Drawing Objects: Uses boxes for session visualization, lines for levels, labels for percentages, table for statistics
Performance: Optimized for real-time use with max limits set (500 boxes, 500 lines, 500 labels)
Calculations Per Bar:
Session detection (3 sessions)
Hourly detection (3 hourly periods)
Pattern classification
Conditional probability lookup
Percentile rank calculation (for session ranges)
All heavy statistical analysis was performed offline. The indicator only performs simple lookups and real-time range tracking.
Educational Value
Beyond trading application, this indicator demonstrates:
Conditional Probability: How market context (opening position, overnight structure) dramatically changes probabilities
Mean Reversion Dynamics: Why certain levels (7-8 AM midpoint, midnight) have such high revisit rates
Pattern Recognition: How overnight session relationships create different NY session behaviors
Distribution Analysis: Using percentile ranks instead of parametric statistics for skewed data
Understanding these concepts helps traders develop more sophisticated market models beyond simple "support and resistance."
Final Notes
This indicator is a tool for informed decision-making, not a crystal ball. It answers questions like:
"What typically happens in this setup?"
"How often does price revisit these levels?"
"Is this overnight range unusual?"
It does NOT answer:
"Should I buy or sell right now?"
"Where will price be at 4 PM?"
"What will happen tomorrow?"
Combine these statistics with proper risk management, sound trading strategy, and awareness that any individual day can deviate significantly from historical norms. The power of this indicator lies in providing objective, data-driven context to complement your analysis - not in replacing your judgment.
CRITICAL DISCLAIMER - READ FIRST
WARNING: THIS INDICATOR IS EXCLUSIVELY FOR NQ (NASDAQ-100 E-MINI FUTURES) ONLY
All statistics displayed in this indicator are HARD-CODED values derived from a comprehensive analysis of 12 years (2013-2025) of 1-minute NQ futures data. These statistics are calculated offline using Python and embedded directly into the indicator code.
These probabilities DO NOT apply to any instrument other than NQ
What This Indicator Does
The NQ Statistical Mapper is a data-driven trading tool that displays historical probability statistics for intraday NQ price behavior based on overnight session structure and opening positioning. Rather than generating signals, it provides context by showing:
Three trading sessions with visual boxes: Asia (8PM-2AM), London (2AM-8AM), and New York (8AM-4PM) Eastern Time
Key price levels with historical hit rate percentages showing the probability these levels are touched during the NY cash session (8AM-4PM)
Context-aware statistics that change based on current market conditions
Session range analysis showing whether Asia and London ranges are unusually large or small compared to recent history
Core Methodology and Statistical Foundation
Pattern Detection System
The indicator automatically detects one of four overnight session patterns based on how the London session (2AM-8AM) interacts with the Asia session (8PM-2AM):
London Engulfs Asia: London high is greater than Asia high AND London low is less than Asia low
Asia Engulfs London: Asia high is greater than or equal to London high AND Asia low is less than or equal to London low
London Partial Up: London high is greater than Asia high BUT London low is greater than or equal to Asia low (took out Asia high only)
London Partial Down: London low is less than Asia low BUT London high is less than or equal to Asia high (took out Asia low only)
Each pattern has distinct statistical characteristics that influence NY session behavior.
Conditional Probability Framework
The indicator uses a conditional probability approach where statistics adapt based on:
Primary Condition: Where does NY open (8:00 AM) relative to the London session midpoint?
"NY opens above London midpoint"
"NY opens below London midpoint"
This single condition dramatically changes the probabilities. For example:
When NY opens above London midpoint: 76.68% chance NY hits the London high before the London low during 8AM-4PM
When NY opens below London midpoint: 73.32% chance NY hits the London low before the London high during 8AM-4PM
Secondary Condition: The overnight pattern further refines these probabilities. Each combination of "NY position vs London midpoint" plus "overnight pattern" has unique hit rate statistics calculated from the 12-year dataset.
"Hit First" Statistics Explained
The table displays "Hit High First" and "Hit Low First" percentages. These answer the question: "During the NY cash session (8AM-4PM), if price eventually touches both the London high AND London low, which one does it touch FIRST?"
Example interpretation:
Hit High First: 76.68% means that in 76.68% of historical days with this setup, price touched the London high before touching the London low
Hit Low First: 22.48% means London low was touched first
The remaining approximately 1% represents days where neither level was hit during the NY session
This is fundamentally different from asking "will price go up or down" - it is about the sequence of range expansion during the NY session.
Displayed Levels and Their Meanings
Session Highs/Lows (Solid Lines)
These appear when each session completes and extend through the NY session:
Asia High/Low (Orange): The highest and lowest prices during 8PM-2AM EST
London High/Low (Blue): The highest and lowest prices during 2AM-8AM EST
Each level shows its hit rate percentage - the probability that NY session price (8AM-4PM) will touch that level, based on the current pattern and NY opening position.
Hourly Midpoint Levels (Dashed Gray Lines)
Three specific hourly levels with remarkably high hit rates:
7-8 AM Midpoint: Average of high and low during the 7-8 AM hour. Hit rates consistently above 93-94%, essentially sitting at the 8 AM open price (mean distance: -0.001%)
Midnight Open: The opening price at midnight EST. Hit rates vary from 62-87% depending on pattern and setup
2-3 AM Midpoint: Average of high and low during the 2-3 AM hour. Hit rates range from 67-92%
These levels are derived from mean-reversion behavior - price tends to revisit certain overnight reference points during the NY session.
Session Midpoints (Dotted Lines)
Optional display of Asia and London session midpoints. These lines terminate when their respective sessions end, providing additional reference levels for session positioning.
Statistics Table Breakdown
The table displays five sections of information:
1. SETUP Section
Shows whether "NY opens above/below London midpoint"
Displays the detected overnight pattern (1 of 4 types)
Sample size: Number of historical days matching this exact setup
Hit High First / Hit Low First: Directional bias percentages
2. HIT RATES (8AM-4PM) Section
Shows probability that each level gets touched at any point during the NY cash session:
7-8 AM Midpoint: Almost always touched (93-97% depending on pattern)
Midnight Open: Varies significantly (62-87%) based on whether the overnight pattern is aligned or contrary to NY's opening position
2-3 AM Midpoint: Strong hit rates (67-92%)
These are independent probabilities - they do not predict which is hit first, just whether each level gets visited.
3. ASIA RANGE Section
Real-time comparison of today's Asia session range versus recent history:
Sessions Captured: Shows how many sessions are in the rolling calculation (e.g., "18 / 50" = 18 sessions captured out of 50 requested). This alerts users if their chart history is insufficient
Current Range: Today's Asia high minus Asia low in points
Mean Range: Average range over the captured sessions
Percentile Rank: Where today's range falls in the distribution
80th percentile (red background): Unusually large range - top 20% of days
60-80th percentile (light gray): Above average
20-60th percentile (white): Normal range
Less than 20th percentile (light blue): Unusually small range - bottom 20% of days
4. LONDON RANGE Section
Identical structure to Asia Range section, analyzing the London session's range characteristics.
Why Percentile Rank Instead of Standard Deviation?
Intraday ranges exhibit right-skewed distributions with fat tails (volatility spikes create extreme outliers). Percentile rank is distribution-free and robust to these characteristics, providing more reliable identification of unusual ranges than z-scores or standard deviations.
How To Use This Indicator
For Context and Confluence
This is not a standalone trading system. The indicator provides statistical context to support other analysis:
Understanding Session Bias: If the table shows 76% probability of hitting the session high first, you know there is a statistical lean toward upside range expansion
Target Setting: If trading a breakout above the overnight high, knowing that Asia high gets hit 75% of the time helps assess target viability
Entry Timing: The 7-8 AM midpoint's 94% hit rate makes it an excellent re-entry or scaling level
Range Expansion Assessment: Percentile rankings help identify whether overnight sessions showed abnormal volatility, which may influence NY session behavior
Pattern-Specific Insights
London Partial Up plus NY Opens Below London Midpoint:
Midnight open hit rate jumps to 87.82% (strong mean reversion)
Suggests counter-trend reversal back toward overnight lows is likely
London Partial Down plus NY Opens Above London Midpoint:
Midnight open hit rate is 86.30%
Mirror pattern - reversion toward overnight highs
Asia Engulfs London Pattern:
Very high hit rates (85-98%) across all levels
Suggests consolidation/mean reversion during NY session rather than directional expansion
Typical Workflow
8:00 AM: Review the statistics table - which pattern occurred? Where did NY open relative to London midpoint?
Check Hit Rates: Note which levels have the highest probabilities of being touched
Assess Range Percentiles: Are Asia/London ranges unusually large or small? High percentiles may indicate already-extended ranges
Combine With Your Strategy: Use the statistics as confluence with your technical analysis, support/resistance, or order flow
Customization Options
Trading Sessions Settings
Session Visualization:
Toggle each session on/off independently
Customize colors for each session (New York, London, Asia)
Adjust background transparency using "Range Area Transparency" slider (0-100, default 90)
Show/hide session outlines with "Range Outline" checkbox
Each session has three customizable parameters on the same line:
Checkbox to enable/disable the session
Text field to rename the session label if desired
Color picker to select the session's display color
Hit Rate Levels Settings
Master Controls:
"Show Hit Rate Levels" - Master toggle to show or hide all level lines and labels
Individual Level Toggles:
"7-8 AM Midpoint" - Toggle the 7-8 AM hour midpoint level
"Midnight Open" - Toggle the midnight opening price level
"2-3 AM Midpoint" - Toggle the 2-3 AM hour midpoint level
Hourly Level Styling (applies to 7-8 AM Mid, Midnight, and 2-3 AM Mid):
"Hourly Level Color" - Color picker for all three hourly levels
"Hourly Level Line Width" - Thickness of hourly level lines (1-5, default 1)
"Hourly Level Line Style" - Choose between Solid, Dashed, or Dotted lines (default Dashed)
Session High/Low Styling (applies to Asia High/Low and London High/Low):
"Session High/Low Line Width" - Thickness of session extreme lines (1-5, default 1)
"Session High/Low Line Style" - Choose between Solid, Dashed, or Dotted lines (default Solid)
Additional Options:
"Show Session Midpoints" - Toggle display of Asia and London midpoint reference lines (dotted lines that end when each session completes)
"Label Text Size" - Size of percentage labels on all levels (tiny, small, normal, large, default small)
Table Settings
Statistics Table Controls:
"Show Statistics Table" - Master toggle to display or hide the entire statistics table
"Stats Table Position" - Choose from 9 positions on the chart:
Top: Top Left, Top Center, Top Right
Middle: Middle Left, Middle Center, Middle Right
Bottom: Bottom Left, Bottom Center, Bottom Right
"Stats Table Size" - Text size within the table (Auto, Tiny, Small, Normal, Large, Huge, default Small)
"Sessions for Stats Calculation" - Number of historical sessions to use for percentile calculations (5-100, default 50)
Lower values (20-30): More responsive to recent market conditions
Higher values (50-100): More stable baseline, requires more chart history
The table displays "Sessions Captured" to show how many sessions were actually available
Important Limitations and Considerations
1. This Is Historical Data, Not Prediction
The statistics show what happened in the past given similar setups. Markets evolve, regimes change, and past probability does not guarantee future outcomes. A 75% hit rate means that in 25% of historical cases, the level was NOT hit.
2. Chart History Requirements
TradingView imposes data limits:
5-minute chart: Approximately 10 days of history (enough for minimal statistics)
1-minute chart: Approximately 2-3 days of history (insufficient for percentile calculations)
Use 5-minute or higher timeframes to ensure adequate session capture
The table displays "Sessions Captured" (e.g., 18/50) to alert you when your chart history is limited.
3. Session Timing Is Fixed (EST)
All sessions use America/New_York timezone:
Asia: 8PM-2AM
London: 2AM-8AM
NY: 8AM-4PM
These times do not adjust for daylight saving changes in other regions. The definitions match CME NQ futures trading hours.
4. The Statistics Are From 2013-2025 Data
The 12-year analysis period includes:
Multiple market regimes (bull/bear/sideways)
Various volatility environments
QE, taper tantrums, COVID, 2022 bear market, 2023-2024 rally
However, it is still a limited sample. Future market structure changes (algorithmic trading evolution, regulatory changes, etc.) may alter these probabilities over time.
5. No Real-Time Calculation
This indicator does not recalculate statistics based on your chart's data. It displays pre-calculated probabilities. The only real-time calculations are:
Which pattern occurred today
Where NY opened relative to London midpoint
Current session ranges and their percentile ranks (based on your chart's recent history)
Statistical Methodology Details
Data Source
Instrument: NQ (Nasdaq-100 E-mini Futures) continuous contract
Timeframe: 1-minute bars
Period: January 2013 - January 2025 (12 years)
Sample Size: 3,132 trading days analyzed
Analysis Approach
Each trading day was classified by overnight pattern (4 types). NY opening position vs London midpoint was determined. For each combination (4 patterns times 2 positions equals 8 scenarios), the following was measured:
How often each level (session highs/lows, hourly midpoints) was touched during 8AM-4PM
Which session extreme (high or low) was hit first
Mean distance from 8 AM open to each level
Session ranges were measured for percentile analysis. All percentages were rounded to two decimal places for display.
Why These Specific Levels?
The levels were not chosen arbitrarily:
Session highs/lows: Natural support/resistance from overnight price discovery
7-8 AM midpoint: The final hour before NY open often establishes the opening range balance point
Midnight open: Represents the "true" start of the trading day (6PM-5PM structure)
2-3 AM midpoint: Captures early London price action balance
Testing showed these levels had the highest and most consistent hit rates across different patterns and setups.
Technical Implementation Notes
Language: Pine Script v5
Drawing Objects: Uses boxes for session visualization, lines for levels, labels for percentages, table for statistics
Performance: Optimized for real-time use with max limits set (500 boxes, 500 lines, 500 labels)
Calculations Per Bar:
Session detection (3 sessions)
Hourly detection (3 hourly periods)
Pattern classification
Conditional probability lookup
Percentile rank calculation (for session ranges)
All heavy statistical analysis was performed offline. The indicator only performs simple lookups and real-time range tracking.
Educational Value
Beyond trading application, this indicator demonstrates:
Conditional Probability: How market context (opening position, overnight structure) dramatically changes probabilities
Mean Reversion Dynamics: Why certain levels (7-8 AM midpoint, midnight) have such high revisit rates
Pattern Recognition: How overnight session relationships create different NY session behaviors
Distribution Analysis: Using percentile ranks instead of parametric statistics for skewed data
Understanding these concepts helps traders develop more sophisticated market models beyond simple "support and resistance."
Final Notes
This indicator is a tool for informed decision-making, not a crystal ball. It answers questions like:
"What typically happens in this setup?"
"How often does price revisit these levels?"
"Is this overnight range unusual?"
It does NOT answer:
"Should I buy or sell right now?"
"Where will price be at 4 PM?"
"What will happen tomorrow?"
Combine these statistics with proper risk management, sound trading strategy, and awareness that any individual day can deviate significantly from historical norms. The power of this indicator lies in providing objective, data-driven context to complement your analysis - not in replacing your judgment.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。