𝙵𝚛𝚊𝚖𝚎𝚠𝚘𝚛𝚔|[𝙰|𝛺]This indicator was designed and coded by me, providing a clean and efficient adaptation of the teachings from Inner Circle Trading (ICT). The tool is intended to display various data points that help streamline and simplify your trading process. However, it does not generate signals or recommendations for trade execution.
It is designed to automatically display different components according to the timeframe you are analyzing. From the Hourly chart down to the seconds, you will be able to visualize a wide range of time-based data points in one indicator.
On the Hourly timeframe, the indicator begins with the Weekly Profile using the True Day . You will be able to visualize Monday’s price extended throughout the entire week, as well as each individual day of the week separately.
You can also visualize the equilibrium and quadrants of each individual day, if desired.
ICT 3-Day Protocol: This feature extends the highs and lows of the previous two days up to the current candle. These levels can serve as potential draws on liquidity or reference points for identifying opportunities on lower timeframes.
M15 Timeframe
On this timeframe, you will be able to visualize the previously mentioned elements, with the addition of the Asian and London sessions. These are included to help outline the potential intraday profile, as well as the highs and lows of these sessions, since they represent relevant data points.
You will also have the option to display projections of these ranges. These projections are useful for anticipating potential price manipulation and distribution levels, using Midnight Open as the reference point for the Daily PO3 .
You will also be able to visualize different Opens , including:
• 00:00
• 08:30
• 09:30
• 13:30
• Previous day’s Settlement Price
These levels represent relevant data points that can be used to frame implied discount or premium conditions relative to the Time of Day .
M1 and Seconds
On this timeframe, you will be able to see the previously mentioned elements, along with additional features.
Market Session Dividers: These are included to provide a clear and organized visual reference of which session the market is currently in, as well as the separation between one session and another.**
Opening Ranges: This feature allows you to visualize the Opening Range of the AM and PM sessions, along with their respective projections. You can also choose whether to extend these ranges over time or keep them limited to their formation period.
First Presentations: This feature allows you to visualize the initial imbalance of the Regular Trading Hours session, including both the AM and PM sessions.
Additionally, an option is included in the menu to indicate if the current day has high-impact news before the 09:30 open, allowing you to consider including the formation of the First Presented Gap from 09:29, as recommended by ICT.
You can also enable alerts to be notified each time a First Presentation is formed.
Table: This feature displays a table with the various Openings mentioned earlier. It shows the price and indicates whether the market is at a Discount or Premium relative to these levels using an arrow.
The table also displays the size of the Opening Range Gap and, with an arrow, indicates whether it is a Premium or Discount Gap.
It provides different possible protocols based on the gap size and other elements taught by ICT to help anticipate certain market scenarios.
Additionally, it shows the current time and changes the color of the time indicator depending on whether you are within a macro session or not. This keeps your chart clean while still allowing you to know if the market is in a macro session.
All elements of the indicator are customizable . You can personalize virtually every component to suit your preferences.
The Engineer.
Cari dalam skrip untuk "session"
smc-vol ••• ahihi🚀 User Guide – SMC-Vol Optimized
📖 Overview
This indicator integrates Smart Money Concepts (SMC) with Volume Analysis to identify high-quality trade entries based on smart money flow behavior.
🎛️ BASIC SETTINGS
Enable/Disable Features
Inside Bar: Show inside/outside bars
PKV: Price-Volume Divergence patterns
HV Monitor: Track High Volume candles (MOST IMPORTANT!)
Color Settings
High Volume Candle: Yellow (default)
PKV: Purple
HV Break: Orange (when HV level is broken)
Daily Open: Blue
📊 HIGH VOLUME (HV) ANALYSIS
HV Settings:
Volume Ratio: 100 (lookback for highest volume)
SNR %: 46% (minimum body/range ratio)
Bars to Monitor: 5 bars (after HV candle appears)
How to Read HV:
Yellow = High Volume candle
Fuchsia = SNR (Supply & Demand Reversal)
🚨 "X" = Pattern breaking HV levels
HV Monitor Table (bottom left corner):
HV Monitor | Status | Details
Last HV | 3B ago | 1.2345/1.2300
Break Status | WATCHING | 3/5
Monitor | 5 Bars | After HV
🎯 TRADING STRATEGY
Step 1: Identify High Volume Candle
Wait for a yellow candle (HV confirmed)
Mark HV High & HV Low
Table shows status: "CURRENT"
Step 2: Track the Next 5 Bars
Table shows "WATCHING" with count (1/5, 2/5…)
Look for patterns:
SKU/SKD: Supply & Demand patterns
SNR_UP/SNR_DOWN: Reversal patterns
CHUOT_UP/CHUOT_DOWN: Hammer / Shooting Star
SK_MOM: Momentum patterns
Step 3: Entry on Pattern Break
🚨 Alert triggers when pattern breaks HV levels
BUY: Break above HV High
SELL: Break below HV Low
🔥 MAIN PATTERNS
SK (Supply/Demand)
SKU (▪️ below candle): Demand pattern, wait for HV Low break → BUY
SKD (▪️ above candle): Supply pattern, wait for HV High break → SELL
CHUOT (Mouse/Hammer)
CU (below): Hammer with long lower wick
CD (above): Shooting Star with long upper wick
SNR (Supply & Demand Reversal)
Small body candle (<46% of range) with low volume
↑ Break HV → Bullish reversal above HV High
↓ Break HV → Bearish reversal below HV Low
📈 MOVING AVERAGES
Three customizable MAs:
MA #1: EMA 21 (Yellow) – Short-term trend
MA #2: EMA 9 (White) – Entry timing
MA #3: EMA 50 (Green) – Long-term trend
Usage:
Bullish: Price > MA #3, MA #2 > MA #1
Entry when: Pattern break + price retest on MA
⏰ SESSION ANALYSIS
Session A (New York):
Range Box: NY Session (19:59–21:59)
Max/Min Lines: Draw session high/low
Custom Sessions:
Pre-Session (11:00–12:00): Blue Box
Main Session (12:00–13:00): Teal Box
Watch for breakout from these ranges
💰 COMPLETE TRADING SETUP
Entry Setup:
Identify HV (Yellow candle)
Wait for pattern (within 1–5 bars)
Confirm Break (🚨 alert + level break)
Enter in breakout direction
SL: Above/Below HV level (depending on direction)
TP: 1:2 or 1:3 Risk/Reward
Extra Filters:
Volume: Enter with increasing volume
MAs: Only trade in main trend direction
Sessions: Prefer entries during active sessions
🚨 ALERTS & NOTIFICATIONS
Two main alerts:
"Price breaks HV directly" → SNR break
"HV level broken" → Pattern break within 5 bars
Setup:
Right-click indicator → "Add Alert"
Select condition
Set notifications (email / Telegram / app)
🎯 TIPS & TRICKS
✅ DO:
Wait for HV confirmation before setup
Trade with trend (MA direction)
Use strict risk management (1–2% per trade)
Backtest before live trading
❌ DON’T:
Enter immediately on pattern (wait for confirmation)
Ignore volume (Volume is key!)
Chase price after breakout
Trade against major trend
💡 Pro Tips:
Combine with Price Action for better entries
Use Multi-Timeframe Analysis
Focus on major pairs in key sessions
Keep a Trading Journal to track performance
📞 SUPPORT & UPDATES
The indicator is continuously optimized to:
Reduce lag & increase accuracy
Add new features
Fix bugs & improve UX
Happy Trading! 🚀💰
EAOBS by MIGVersion 1
1. Strategy Overview Objective: Capitalize on breakout movements in Ethereum (ETH) price after the Asian open pre-market session (7:00 PM–7:59 PM EST) by identifying high and low prices during the session and trading breakouts above the high or below the low.
Timeframe: Any (script is timeframe-agnostic, but align with session timing).
Session: Pre-market session (7:00 PM–7:59 PM EST, adjustable for other time zones, e.g., 12:00 AM–12:59 AM GMT).
Risk-Reward Ratios (R:R): Targets range from 1.2:1 to 5.2:1, with a fixed stop loss.
Instrument: Ethereum (ETH/USD or ETH-based pairs).
2. Market Setup Session Monitoring: Monitor ETH price action during the pre-market session (7:00 PM–7:59 PM EST), which aligns with the Asian market open (e.g., 9:00 AM–9:59 AM JST).
The script tracks the highest high and lowest low during this session.
Breakout Triggers: Buy Signal: Price breaks above the session’s high after the session ends (7:59 PM EST).
Sell Signal: Price breaks below the session’s low after the session ends.
Visualization: The session is highlighted on the chart with a white background.
Horizontal lines are drawn at the session’s high and low, extended for 30 bars, along with take-profit (TP) and stop-loss (SL) levels.
3. Entry Rules Long (Buy) Entry: Enter a long position when the price breaks above the session’s high price after 7:59 PM EST.
Entry price: Just above the session high (e.g., add a small buffer, like 0.1–0.5%, to avoid false breakouts, depending on volatility).
Short (Sell) Entry: Enter a short position when the price breaks below the session’s low price after 7:59 PM EST.
Entry price: Just below the session low (e.g., subtract a small buffer, like 0.1–0.5%).
Confirmation: Use a candlestick close above/below the breakout level to confirm the entry.
Optionally, add volume confirmation or a momentum indicator (e.g., RSI or MACD) to filter out weak breakouts.
Position Size: Calculate position size based on risk tolerance (e.g., 1–2% of account per trade).
Risk is determined by the stop-loss distance (10 points, as defined in the script).
4. Exit Rules Take-Profit Levels (in points, based on script inputs):TP1: 12 points (1.2:1 R:R).
TP2: 22 points (2.2:1 R:R).
TP3: 32 points (3.2:1 R:R).
TP4: 42 points (4.2:1 R:R).
TP5: 52 points (5.2:1 R:R).
Example for Long: If session high is 3000, TP levels are 3012, 3022, 3032, 3042, 3052.
Example for Short: If session low is 2950, TP levels are 2938, 2928, 2918, 2908, 2898.
Strategy: Scale out of the position (e.g., close 20% at TP1, 20% at TP2, etc.) or take full profit at a preferred TP level based on market conditions.
Stop-Loss: Fixed at 10 points from the entry.
Long SL: Session high - 10 points (e.g., entry at 3000, SL at 2990).
Short SL: Session low + 10 points (e.g., entry at 2950, SL at 2960).
Trailing Stop (Optional):After reaching TP2 or TP3, consider trailing the stop to lock in profits (e.g., trail by 10–15 points below the current price).
5. Risk Management per Trade: Limit risk to 1–2% of your trading account per trade.
Calculate position size: Account Size × Risk % ÷ (Stop-Loss Distance × ETH Price per Point).
Example: $10,000 account, 1% risk = $100. If SL = 10 points and 1 point = $1, position size = $100 ÷ 10 = 0.1 ETH.
Daily Risk Limit: Cap daily losses at 3–5% of the account to avoid overtrading.
Maximum Exposure: Avoid taking both long and short positions simultaneously unless using separate accounts or strategies.
Volatility Consideration: Adjust position size during high-volatility periods (e.g., major news events like Ethereum upgrades or macroeconomic announcements).
6. Trade Management Monitoring :Watch for breakouts after 7:59 PM EST.
Monitor price action near TP and SL levels using alerts or manual checks.
Trade Duration: Breakout lines extend for 30 bars (script parameter). Close trades if no TP or SL is hit within this period, or reassess based on market conditions.
Adjustments: If the market shows strong momentum, consider holding beyond TP5 with a trailing stop.
If the breakout fails (e.g., price reverses before TP1), exit early to minimize losses.
7. Additional Considerations Market Conditions: The 7:00 PM–7:59 PM EST session aligns with the Asian market open (e.g., Tokyo Stock Exchange open at 9:00 AM JST), which may introduce higher volatility due to Asian trading activity.
Avoid trading during low-liquidity periods or extreme volatility (e.g., major crypto news).
Check for upcoming events (e.g., Ethereum network upgrades, ETF decisions) that could impact price.
Backtesting: Test the strategy on historical ETH data using the session high/low breakouts for the 7:00 PM–7:59 PM EST window to validate performance.
Adjust TP/SL levels based on backtest results if needed.
Broker and Fees: Use a low-fee crypto exchange (e.g., Binance, Kraken, Coinbase Pro) to maximize R:R.
Account for trading fees and slippage in your position sizing.
Time zone Adjustment: Adjust session time input for your time zone (e.g., "0000-0059" for GMT).
Ensure your trading platform’s clock aligns with the script’s time zone (default: America/New_York).
8. Example Trade Scenario: Session (7:00 PM–7:59 PM EST) records a high of 3050 and a low of 3000.
Long Trade: Entry: Price breaks above 3050 (e.g., enter at 3051).
TP Levels: 3063 (TP1), 3073 (TP2), 3083 (TP3), 3093 (TP4), 3103 (TP5).
SL: 3040 (3050 - 10).
Position Size: For a $10,000 account, 1% risk = $100. SL = 11 points ($11). Size = $100 ÷ 11 = ~0.09 ETH.
Short Trade: Entry: Price breaks below 3000 (e.g., enter at 2999).
TP Levels: 2987 (TP1), 2977 (TP2), 2967 (TP3), 2957 (TP4), 2947 (TP5).
SL: 3010 (3000 + 10).
Position Size: Same as above, ~0.09 ETH.
Execution: Set alerts for breakouts, enter with limit orders, and monitor TPs/SL.
9. Tools and Setup Platform: Use TradingView to implement the Pine Script and visualize breakout levels.
Alerts: Set price alerts for breakouts above the session high or below the session low after 7:59 PM EST.
Set alerts for TP and SL levels.
Chart Settings: Use a 1-minute or 5-minute chart for precise session tracking.
Overlay the script to see high/low lines, TP levels, and SL levels.
Optional Indicators: Add RSI (e.g., avoid overbought/oversold breakouts) or volume to confirm breakouts.
10. Risk Warnings Crypto Volatility: ETH is highly volatile; unexpected news can cause rapid price swings.
False Breakouts: Breakouts may fail, especially in low-volume sessions. Use confirmation signals.
Leverage: Avoid high leverage (e.g., >5x) to prevent liquidation during volatile moves.
Session Accuracy: Ensure correct session timing for your time zone to avoid misaligned entries.
11. Performance Tracking Journaling :Record each trade’s entry, exit, R:R, and outcome.
Note market conditions (e.g., trending, ranging, news-driven).
Review: Weekly: Assess win rate, average R:R, and adherence to the plan.
Monthly: Adjust TP/SL or session timing based on performance.
legend fox concepts reversal 2.0
The Legend Fox Concepts Reversal is a comprehensive tool that integrates multiple trading elements, including Trading Sessions, Previous Daily and 4-Hour Levels, and the Imbalance Concept, into a single system designed to help traders identify potential reversal points. The indicator visually highlights these opportunities by generating clear signals, such as green arrows for bullish setups and red arrows for bearish setups. It is particularly effective when applied on shorter timeframes and works best in conjunction with trading futures products, helping traders anticipate market turning points with greater precision.
The indicator is comprised of four essential components, each designed to enhance the trader’s experience and adaptability:
1. Preset Method:
◦ Includes presets that plot Previous Daily and 4-Hour High/Low Levels on the chart, visually distinguished by orange and yellow colors. These levels can be configured in four distinct combinations to suit various trading styles, helping users identify key support and resistance zones. Traders have the option to enable or disable these levels based on their strategy, offering enhanced flexibility and clarity for analyzing potential price reactions.
2. Time Parameters:
◦ Allows users to define specific trading hours based on different financial market sessions worldwide. This component is segmented into four distinct parts, enabling users to customize session times to align with their preferred trading windows. Each segment is color-coded for visual clarity and can be independently enabled or disabled, offering precision in tracking session-specific price action and highlighting relevant market activity.
3. Profit Method:
◦ Supports up to four target price levels, defined in either Ticks or Standard Deviations. This feature is especially useful when trading multiple contracts, allowing for a structured approach to taking profits. Users can customize settings such as Distribution Width, Source of Mean, and Price Reference to standard deviations, tailoring the take-profit strategy to fit unique trading goals.
4. Imbalance Setup:
◦ Refers to the size of gaps between candles, an important factor in anticipating potential reversal signals. Depicted as gray for bullish and blue for bearish imbalances, users can modify the gap width, helping to fine-tune the timing of signals to detect reversals earlier or later depending on market conditions.
Use Case:
• Trading Session Setup:
The trading session is defined by the user as Asia (represented by yellow lines on the chart, with time set between 18:00 - 24:00) and London (depicted by blue lines, with time set between 24:00 - 7:00). This segmentation helps to visually differentiate and track the activity within each session.
• Daily Breach preset:
Next, the Daily Breach preset is applied by enabling the Previous Daily Candle High and Low levels to be displayed on the chart (marked by orange dashed lines). These levels serve as key reference points for potential breakouts or reversals.
• Contract Allocation and Take Profit Setup:
We have input the number of contracts to trade: using 4 contracts for the NQ (Nasdaq Futures). The take-profit levels are defined using ticks. For example, once TP1 is reached at 50 ticks, 2 contracts are closed, leaving the remaining 2 contracts to be closed at TP2, which is set at 100 ticks.
• No Trade Signal Detected:
In this instance, price did not hit any of the Previous Daily High or Low levels, so no trade signal was generated.
• Price Action During the London Session:
Price rallied during the London session, forming bullish imbalances marked by blue areas. It then hit a Previous Daily Level, reversed, and crossed back through the bullish imbalance, indicating a potential reversal. A sell signal was generated, shown as a red arrow, along with a pre-determined stop-loss and two take-profit levels. Additionally, a red dot below indicated a possible downward reversal.
• Successful Take Profit Execution:
Price reached both Target Price 1 and Target Price 2, completing the trade as expected.
By seamlessly integrating these components, the tool empowers users to customize their trading strategies by combining different elements to create unique setups that suit their individual trading styles. Additionally, various presets are available, along with comprehensive guidance on how to leverage the tool to its fullest potential.
90 Minute Cycles + MTFCredit goes to LuxAlgo for the inspiration from 'Sessions' which allowed users to analyse specific price movements within a user defined period with tools such as trendline, mean and vwap.
Settings
Sessions
Enable Session: Allows to enable or disable all associated elements with a specific user set session.
Session Time: Opening and closing times of the user set session in the hh:mm format.
Range: Highlights the associated session range on the chart.
Ranges Settings
Range Area colour: Set each range to a specific colour.
Range Label: Shows the session label at the mid-point of the session interval.
Usage
By breaking 24hrs in quarters, starting with an Asian range of 18:00 NY time you can visualise the principles of Accumulation, Manipulation, Distribution and Rebalance. Know as AMD or PO3 (Power of Three), the principle is that the Manipulation phase will break above or below the Accumulation, before moving in an apposing direction and then rebalancing. This only works when there is a higher timeframe PD array or liquidity to support an apposing move.
Further to the daily quarters, each one can then be broken down again into 90min cycles. Again, each represents AMD, allowing the user an opportunity to watch for reversals during the 90min manipulation phase.
Note: Ensure the Asian Cycle always begins at 18:00 NY time.
The example shows that the 90min cycle occurs, followed by an apposing move away in price action
Here is the Daily cycle, highlighting the Manipulation phase.
Enjoy!
Trading IVBDiscover the power of precision with Trading Sessions IVB – Multi Sessioni, the ultimate intraday tool for session analysis and automatic target generation. Instead of manually calculating levels, this indicator instantly transforms each trading session into a clear, structured framework on your chart.
As soon as a session begins, a dynamic box highlights its price range in real time. From that simple box, the indicator automatically creates high-probability targets: percentage levels at ±0.5% and ±0.61% to capture quick intraday moves, and projection levels at one and two times the session’s range to anticipate powerful breakouts. These targets appear instantly and update live, giving you predefined levels to trade around without the guesswork.
Whether you focus on London, New York, or any custom session, the indicator adapts to your setup, extending ranges to your chosen cutoff time and showing only the most recent sessions you care about. With its clean visual design and automated target generation, you’ll always know where price is most likely to react, retrace, or expand.
Stop wasting time on manual calculations and start trading with a tool that does the heavy lifting for you. Trading Sessions IVB – Multi Sessioni turns raw market sessions into ready-to-use trading levels, helping you trade with more clarity, speed, and confidence.
MultiSessions traderglobal.topEste indicador de sesiones está diseñado para traders intradía que desean visualizar con precisión la actividad y la volatilidad característica de cada mercado. Basado en Pine Script v5 y optimizado para la zona horaria “America/New_York”, divide el día en sub-sesiones configurables y resalta sus rangos de precio en tiempo real. En particular, incorpora tres bloques para New York (NY1, NY2, NY3), dos para Londres (LON1, LON2), dos para Tokio (TKO1, TKO2) y mantiene Sídney como sesión opcional. Cada bloque puede activarse o desactivarse de forma independiente y cuenta con su propio color ajustable, lo que permite construir mapas visuales claros para estrategias basadas en horario, solapamientos y micro-estructuras de mercado.
El panel de inputs incluye la opción “Activate High/Low View”. Cuando está activada, el indicador calcula de manera incremental el mínimo y máximo de cada sub-sesión y sombrea el área entre ambos con fill, proporcionando una referencia inmediata del rango intrasesión (útil para medir compresión/expansión y posibles rompimientos). Cuando está desactivada, emplea un simple bgcolor por bloque, ideal para traders que prefieren un gráfico más limpio y solo desean distinguir visualmente los tramos horarios.
La lógica central utiliza dos funciones auxiliares: is_session(sess), que detecta si la vela actual pertenece a un tramo horario concreto, e is_newbar(sess), que determina el inicio de una nueva barra de referencia según la resolución elegida (D, W o M). Gracias a esta combinación, en cada sub-sesión el indicador reinicia sus contadores de alto y bajo al comenzar el período y los actualiza vela a vela mientras el bloque siga activo. Este enfoque evita mezclas de datos entre sesiones y asegura que el rango que se muestra corresponda estrictamente al segmento horario configurado.
Los horarios por defecto están pensados para Forex y contemplan casos que cruzan medianoche (por ejemplo, Tokio 2 y Sídney). Pine Script admite rangos como 2200-0200; no obstante, si tu bróker o la zona horaria del gráfico generan un sombreado parcial, basta con dividir el tramo en dos: 2200-2359 y 0000-0200. Asimismo, cada input.session incluye el patrón :1234567 para habilitar los siete días; puedes restringir días según tu operativa.
En cuanto al uso práctico, el indicador facilita identificar: (1) la estructura del rango por sub-sesión (útil para estrategias de breakout/mean-reversion), (2) los solapamientos entre Londres y New York, donde suele concentrarse la liquidez, y (3) períodos de menor volatilidad (tramos tardíos de Asia o previos a noticias). El color independiente por bloque te permite codificar visualmente la importancia o tu plan de trading (por ejemplo, tonos más intensos en ventanas de alta probabilidad).
Finalmente, su diseño modular hace sencilla la personalización: puedes ajustar colores, activar/desactivar bloques, cambiar horarios y modificar la resolución de reseteo del rango. Como posible mejora, se pueden añadir alertas de ruptura de máximos/mínimos de sub-sesión o etiquetas con la altura del rango (pips) al cierre. Este indicador no sustituye el juicio del trader ni constituye recomendación financiera, pero ofrece una base visual robusta para integrar el factor tiempo en la toma de decisiones.
This sessions indicator is built for intraday traders who want a precise, time-aware view of market activity and typical volatility patterns across the day. Written in Pine Script v5 and optimized for the “America/New_York” timezone, it divides the trading day into configurable sub-sessions and highlights their price ranges in real time. Specifically, it provides three blocks for New York (NY1, NY2, NY3), two for London (LON1, LON2), two for Tokyo (TKO1, TKO2), and keeps Sydney as an optional session. Each block can be enabled or disabled independently and comes with its own adjustable color, letting you build clear visual maps for time-based strategies, overlaps, and microstructure nuances.
In the inputs panel you’ll find the “Activate High/Low View” option. When enabled, the indicator incrementally computes each sub-session’s low and high and shades the area between them with fill, giving you an immediate reference to the intra-session range (useful for gauging compression/expansion and potential breakouts). When disabled, it switches to a clean bgcolor background by block—ideal if you prefer a minimal chart and simply want to distinguish time windows at a glance.
The core logic relies on two helper functions: is_session(sess), which detects whether the current bar falls within a given time window, and is_newbar(sess), which identifies the start of a new reference bar according to your chosen reset resolution (D, W, or M). With this combination, each sub-session resets its high/low at the beginning of the period and updates them bar by bar while the block remains active. This prevents cross-contamination between sessions and ensures the range you see belongs strictly to the configured segment.
Default hours are suited to Forex and include segments that cross midnight (e.g., Tokyo 2 and Sydney). Pine Script supports ranges like 2200-0200; however, if your broker or chart timezone causes partial shading, simply split the segment into two: 2200-2359 and 0000-0200. Each input.session uses the :1234567 suffix to enable all seven days; you can easily restrict days to match your plan.
Practically speaking, the indicator helps you identify: (1) range structure by sub-session (great for breakout or mean-reversion frameworks), (2) overlaps between London and New York, where liquidity and directional moves often concentrate, and (3) lower-volatility windows (late Asia or pre-news lulls). Independent colors per block let you visually encode priority or your trading plan (for example, richer tones in high-probability windows).
Thanks to its modular design, customization is straightforward: adjust colors, toggle blocks, change hours, and tweak the range-reset resolution to suit your routine. As a natural extension, you can add alerts for sub-session high/low breakouts or labels that display the range height (in pips) at session close. While no indicator replaces trader judgment or constitutes financial advice, this tool offers a robust visual foundation for incorporating the time factor directly into your decision-making, helping you contextualize price action within the rhythm of global trading sessions.
Intraday vs Overnight OBV🔍 Purpose
This indicator provides a volume-weighted cumulative flow model that mimics On-Balance Volume (OBV) logic but splits the volume impact into intraday vs. overnight sessions. It allows traders to track how volume contributes to price movement in each session and identify whether buying/selling pressure is stronger during or outside of regular trading hours.
This indicator attempts to alleviate some of the downfalls of the standard OBV indicator, which only looks at total volume and total direction. The price of stocks generally behaves extremely differently during market hours and outside market hours, and many of the large moves happen outside of regular market hours on low volume.
⚙️ Core Features
1) OBV-style calculation:
If price increases → volume is added to the OBV stream.
If price decreases → volume is subtracted.
If price is flat → OBV remains unchanged.
2) Session splitting:
Intraday session: movement from today's open to close.
Overnight session: movement from yesterday’s close to today’s open.
Volume is split proportionally between these two periods based on user input.
3) Four visualization modes:
"Intraday" — plots only OBV from intraday price movement.
"Overnight" — plots only OBV from overnight price movement.
"Aggregate" — plots the sum of intraday and overnight OBV for a holistic view.
"Both Intraday and Overnight" — plots intraday and overnight OBV separately on the same chart.
📐 Inputs
1) Synthetic OBV Type:
"Intraday" — Show OBV from open to close only.
"Overnight" — Show OBV from prior close to today's open only.
"Aggregate" — Show a single line combining both.
"Both Intraday and Overnight" — Show both lines on the same chart.
2) Estimated Overnight Volume %:
Percentage of total daily volume assumed to occur during extended hours.
The rest is allocated to regular session (intraday).
Default: 20% overnight, 80% intraday.
🧮 How It Works
Volume Splitting:
Total bar volume is split into overnight Volume and intraday Volume:
Intraday change is the difference between today’s close and open.
Overnight change is the difference between today’s open and yesterday’s close.
Session OBV Calculations:
OBV is incremented/decremented by the session's allocated volume, depending on whether the session’s price change was positive or negative.
Aggregate OBV:
Combines both session deltas for a holistic volume flow view.
📊 Interpretation
Rising OBV (any stream) suggests accumulation; falling OBV suggests distribution.
Divergences between price and OBV lines (especially overnight vs. intraday) can reveal where hidden buying/selling is occurring.
Comparing intraday vs overnight OBV can help:
Spot whether institutional demand is building off-hours.
Detect retail vs. institutional behavior (retail trades often dominate intraday; institutional may prefer after-hours).
💡 Use Cases
Identify whether overnight gaps are supported by overnight volume momentum.
Detect accumulation in low-volume overnight sessions.
Compare intraday and overnight strength during earnings season or news events.
Complement traditional OBV by seeing session-based breakdowns.
OpeningRange (Trading_Tix)Purpose:
The indicator highlights the high, low, and middle (50%) price levels of a specified session's opening range. These levels can serve as key support and resistance zones for trading strategies. The indicator also offers options to extend these levels beyond the session into later timeframes, making it useful for tracking breakout or trend continuation setups.
Key Features:
1. Session Detection:
The indicator identifies a specific session period using the user-defined Session Time. It calculates the start time, high, and low prices during this period:
rangeTime: Defines the session time range (default: 5:00 PM to 2:59 AM).
extendTime: Defines the extended time range where lines/backgrounds can be prolonged.
2. Opening Range Calculation:
High (high_val) and Low (low_val)**:
Tracks the highest and lowest prices during the session.
Middle Line:
A midpoint is calculated by averaging high_val and low_val.
3. Visual Elements:
Horizontal Lines:
Drawn at the high, low, and middle levels.
Customizable in width and color.
Shaded Background Box:
Covers the range between high and low prices.
The box’s color and transparency can be adjusted.
Line and Box Extension:
Optionally extends these elements into the extended time range.
4. Customization:
Users have the flexibility to:
Toggle visibility of lines, middle line, and background box.
Adjust colors, line thickness, and style.
Enable or disable the extension of lines and backgrounds into the extended period.
How It Works:
Initialization:
The script initializes variables to store range data (startTime, high_val, low_val) and drawing objects (lines, boxes).
It detects whether the current bar falls within the session (inSession) or extended timeframe (inExtend).
Plotting:
During the session:
Deletes previous lines and boxes from prior sessions.
Draws new lines at the high, low, and middle levels.
Creates a background box covering the range, if enabled.
During the extended period:
Extends the session lines and box, if the user has opted for extensions.
Updates:
Continuously adjusts the high/low values and updates the lines as new price data arrives.
Use Cases:
This indicator can be valuable for traders who:
Use the opening range to identify potential breakout zones.
Trade based on price consolidation within the range.
Want a visual representation of key price levels to plan entries and exits.
Would you like help refining this script further or adjusting its settings to match your trading style?
POA Volume TrackerCustomizable Volume Tracker Indicator
This custom TradingView indicator tracks and displays volume data across three key market sessions: Pre-Market, Open Market, and After-Hours. It is designed to give traders insights into the volume activity during these distinct trading periods, helping them make more informed decisions.
Key Features:
Pre-Market Volume (PMV): Shows the total volume of trades during the pre-market session.
Open Market Volume (OMV): Displays the total volume during regular market hours.
After-Hours Volume (AHV): Shows the total volume in the after-hours session.
All three values are displayed in an easy-to-read format, and the script includes the following customization options:
Adjustable Label Position: Choose between placing the label Above the current candle or to the Right side of the candle.
Customizable Offsets: Adjust the vertical and horizontal positioning of the label to suit your preferences.
Volume Formatting: The script automatically formats the volume values for easier readability, displaying large volumes with suffixes like "k" for thousands and "M" for millions.
Customization Options:
Text Size: Choose the size of the text used in the label.
Text and Background Colors: Adjust the color of the label text and background to match your chart style.
Positioning: Move the label up or down, and adjust how far to the right (or left) it appears next to the current candle.
Volume Formatting: Automatically formats volume values to be more readable (e.g., 1,250,000 becomes 1.25M).
This indicator is perfect for traders who want to keep track of volume data for different market sessions and adjust how that data is displayed on their charts in a clear and customizable manner.
How to Use:
Add this script to your chart, and choose your desired market session timeframes.
Use the input options to adjust the label’s position and appearance.
View the real-time volume data for Pre-Market, Open Market, and After-Hours, all in one place.
You wanna catch some gainz? pair this with the Market Cap indicator for some solid TA and catch some $ with the big boys.
London Intraday Protraction (Normal + Delayed) [Pro+]The London Intraday Protraction° is an automatic market profiling tool designed from ICT Time and price parameters projected for London Session studies:
Time:
Central Bank Dealers Range (CBDR)
Asian Range (AR)
London Session
Price:
Central Bank Dealers Range Size (CBDR)
Central Bank Dealers Range (CBDR) Standard Deviations
Asian Range Size (AR)
Protraction (fake move, trap)
This tool allows you to keep your attention dialled into the Session harnessing the concepts listed above through historical data (statistics + previous sessions), and live visuals.
This tool automatically annotates your CBDR and AR reference points, and prints range values in pips as a label above the CBDR and AR; it also projects the CBDR deviations encompassed in London's Time opportunity – up to three standard deviations.
The range values for the Time-based ranges, and price action are filtered into conditional statements as taught in the Core Content from the Inner Circle Trader (ICT).
There are three profile types:
1) Normal Protraction – the high/low of the Day is anticipated in early London Session.
2) Delayed Protraction – due to invalid Price Parameters (Range Sizes) the Protraction is expected in the later stages of the London Session (this protraction may, or may not be, the high/low of the Day).
3) Normal Protraction Negated – due to invalid Time Parameters, the Protraction is expected in the later stages of the London Session (this protraction may, or may not be, the high/low of the Day).
Notice the color coding of the specific scenarios, as it always repeats – it will aid pattern recognition.
The statistical table shows the total number of viewable London Sessions on chart; it provides the total number of filtered Normal Protraction Sessions, and Delayed Protractions Sessions. It also indicates a percentage of how many filtered conditions held true and provided clean price action or narrative.
The true power of this tool lies in its specific window of Time opportunity, and solid conditional logic provided by ICT's teachings; having the London Session analysis automated, allows you to focus on price, and bias, rather than drawing predetermined ICT parameters.
Additional Features:
Customizable Colors
Auto-adapting Colors
Customizable Stat Table Position
Customizable Stat Table Size
These tools are available ONLY on the TradingView platform.
Terms and Conditions
These charting tools are products provided for informational and educational purposes only and do not constitute financial, investment, or trading advice. They are not designed to predict market movements or provide specific recommendations. Users should be aware that past performance is not indicative of future results and should not be relied upon for making financial decisions. By using these tools, the purchaser agrees that the seller and the creator are not responsible for any decisions made based on the information provided by these charting tools. The purchaser assumes full responsibility and liability for any actions taken and the consequences thereof, including any loss of money or investments that may occur as a result of using these products. Hence, by purchasing these charting tools, the customer accepts and acknowledges that the seller and the creator are not liable nor responsible for any unwanted outcome that arises from the development, the sale, or the use of these products. Finally, the purchaser indemnifies the seller from any and all liability.
By continuing to use these financial tools, the user acknowledges and agrees to the terms outlined in this legal disclaimer.
ICT KEY LEVELS (L3J)📊 Overview
The ICT KEY LEVELS (L3J) indicator is a tool designed to automatically identify and display key levels based on Inner Circle Trader (ICT) concepts.
This indicator combines session-based levels with multi-timeframe highs/lows analysis to provide traders with critical price zones for decision-making.
Developed by L3J - This indicator can be used in conjunction with other indicators I have developed for enhanced market analysis.
🎯 Key Features
Session-Based Levels
- Previous Day High/Low (PDH/PDL): Automatically identifies and displays the previous trading day's high and low levels
- Asian Session Levels: Tracks high and low during Asian trading hours (20:00-03:00 GMT+4)
- European Session Levels: Captures London session high and low levels (03:00-08:30 GMT+4)
Multi-Timeframe Analysis
- H1 Pivot Levels: Identifies 2-candle reversal patterns on 1-hour timeframe
- H4 Pivot Levels: Detects 4-hour pivot points using advanced pattern recognition
- Smart Visibility: Levels are only shown on appropriate timeframes (H1 levels on H1, H4 levels on H4)
Advanced Features
- Priority System: Automatically hides overlapping levels based on importance (Previous Day > Sessions > H4 > H1)
- Dynamic Labels: Real-time labels that update with price action
- Intelligent Cleanup: Removes crossed or outdated levels to maintain chart clarity
- Customizable Anchoring: Choose between precise timestamp anchoring or candle middle anchoring
- Performance Optimized: Built with efficient code structure for smooth chart performance
⚙️ Configuration Options
Note: Currently, the user interface settings are displayed in French. This will be updated to English in a future version.
General Settings
- Timezone: Configurable timezone for session calculations (default: GMT+4)
- Trading Days: Number of trading days to analyze (1-20 days)
- Extension: Right extension length for level lines
- Anchoring Mode: Precise timestamp or candle middle anchoring
Visual Customization
Each level type (Asia, Europe, Previous Day, H1, H4) includes:
- Color Selection: Separate colors for highs and lows
- Line Styles: Solid, Dotted, or Dashed lines
- Line Width: Adjustable thickness (1-4 pixels)
- Show/Hide Toggle: Individual control for each level type
🕒 Session Times
- Trading Day: 18:00-16:00 (CME session)
- Asian Session: 20:00-03:00 GMT+4
- European Session: 03:00-08:30 GMT+4
All times are configurable and timezone-aware
📈 How It Works
Level Detection
1. Session Levels: Continuously tracks price action during specific trading sessions
2. Pivot Detection: Uses 2-candle reversal patterns (bullish then bearish for highs, bearish then bullish for lows)
3. Multi-Timeframe Data: Requests higher timeframe data for H1 and H4 analysis
Smart Management
- Automatic Cleanup: Removes levels that have been crossed or are too old
- Priority Filtering: Hides duplicate levels based on importance hierarchy
- Dynamic Updates: Real-time adjustment of level positions and labels
🎨 Visual Elements
- Horizontal Lines: Extend from level creation point to the right
- Dynamic Labels: Show level type and session information
- Color Coding: Different colors for each session and timeframe
- Transparency: Automatically hides overlapping or less important levels
🔧 Technical Specifications
- Pine Script Version: v6
- Chart Overlay: True
- Max Lines: 500
- Max Labels: 50
- Performance: Optimized with intelligent memory management
📋 Usage Tips
1. Best Timeframe: Works on all timeframes, but H1 and lower provide optimal detail
2. Combine with Price Action: Use levels as confluence zones for entry/exit decisions
3. Risk Management: Levels can serve as stop-loss and take-profit targets
4. Market Structure: Helps identify key support/resistance in market structure analysis
🔄 Compatibility
This indicator is designed to work alongside other L3J indicators for comprehensive market analysis.
📞 Support & Updates
For questions, suggestions, or updates, please contact L3J through TradingView messaging.
---
Disclaimer : This indicator is for educational and analysis purposes. Always practice proper risk management and never risk more than you can afford to lose.
Version: 1.0
Author: L3J
Last Updated: 30/08/2025
Delta Zones🔶 Delta Zones — A Precision Tool for Time-Price Mapping 🔶
The Delta Zones indicator is a refined structure-mapping tool that dynamically tracks zones of dominant trading activity across recent sessions.
These zones are projected forward in time, offering traders a reliable visual guide to where significant interactions between buyers and sellers are likely to take place.
This tool was designed for intraday use, but its adaptability makes it powerful even on higher timeframes, giving traders insights into market behavior without the noise. You need to change session setting from indicator to higher TF that the chart. For intra, its by default on daily.
🔧 What This Indicator Does
Detects and displays the key activity zone for the current session (today).
Recalls the most active zone from the previous session, allowing you to track momentum or reversal bias.
Color codes each zone based on where price currently trades relative to it:
Neutral gradient (orange/white) for today’s zone, showing where price is consolidating or reacting.
Bullish green fade if price is trading above yesterday’s zone.
Bearish red fade if price is trading below yesterday’s zone.
Extends each zone forward (default 200 bars) so you can observe price behavior as it revisits these areas over time.
📈 How to Use Delta Zones
Trend Continuation:
If price pushes beyond today's zone and maintains momentum, it may suggest strength in that direction. Watch how price reacts on retests of this zone.
Fade or Mean Reversion:
When price strays far from a Delta Zone and struggles to gain ground, it often rotates back into that region. These situations can offer attractive risk-reward setups.
Zone Polarity from Prior Sessions:
Yesterday’s zone serves as a directional cue — if price opens and stays above it (green-filled), sentiment favors strength. If it stays below (red-filled), weakness may persist.
Support/Resistance Anchors:
Use zones as dynamic S/R levels — watch for wick tests, engulfing candles, or volume surges at zone edges for potential trade entries or exits.
🎛️ Inputs You Can Control
Session Length (Default: Daily): Defines how often a new zone is calculated.
💡 Pro Tip
These zones act like magnetic fields around price — not only can they contain price, but they also attract it. The key is to recognize when price is respecting, rejecting, or absorbing at the edges of the zone.
Pair Delta Zones with your favorite price action, momentum, or volume tools for sharper decision-making. For example, "Accumulation/Distribution Money Flow" script which I published few days ago.
⚠️ Note
This is a conceptually adaptive framework designed to simplify the visual structure of the market. While no model guarantees predictive accuracy, Delta Zones are especially useful for contextualizing price behavior and anticipating where meaningful reactions may occur.
This is an educational idea, use it at your own risk.
Past performance does not guarantee future success.
Timing KenhTradding The Timing KenhTradding indicator is a versatile and customizable tool designed to provide detailed insights into market sessions, daily price dynamics, and key levels. This indicator is especially helpful for traders aiming to track volatility, session-specific movements, and broader trends with additional tools like EMA and VWAP.
Key Features
Session Tracking:
Visualizes up to 8 customizable sessions using shaded boxes on the chart.
Sessions are defined by specific time intervals and are labeled with user-defined names and colors for easy identification.
EMA Integration:
Displays two critical exponential moving averages (EMA):
EMA200 (1-minute): Ideal for short-term trend analysis.
EMA200 (4-hour): Provides a broader perspective on market trends.
EMA smoothing options ensure clarity and reduce noise.
Daily High, Low, Open, and Close Levels:
Automatically draws horizontal lines to highlight the daily high, low, and open prices.
Displays these levels with annotations and customizable colors.
Price Movement Representation:
Visualizes daily price movements using boxes for the body, upper wick, and lower wick:
The body shows the range between the open and close.
The upper and lower wicks represent the highs and lows relative to the body.
Annotations display the exact pip/movement size of the wicks.
VWAP Overlay:
Plots the Volume Weighted Average Price (VWAP) to provide a weighted average of price levels based on volume, aiding in intraday decision-making.
Session-Based Background Highlighting:
Highlights specific hours (e.g., 2 AM) with a customizable background color for better visual segmentation.
Dynamic Data Updates:
Updates key levels and boxes dynamically as new price data becomes available.
Benefits for Traders
Session Analysis:
Easily identify and analyze the behavior of price action within specific trading sessions, such as high volatility around news events.
Trend and Momentum Tracking:
Use EMA and VWAP overlays to gauge the direction and strength of the market.
Daily Levels for Precision:
Incorporates high, low, and open levels to assist with setting entry, exit, and stop-loss points.
Visual Clarity:
Simplifies complex market data with clean and intuitive visualizations, enabling traders to make informed decisions quickly.
Customization Options
Sessions:
Define up to 8 custom sessions with personalized labels, time zones, and colors.
Visuals:
Adjust colors, transparency, and line styles for session boxes, EMAs, and daily levels.
Text Details:
Customize text size, alignment, and colors for annotations and labels.
EMA Display:
Toggle between short-term and long-term EMA views.
How to Use It
Track Daily Levels:
Watch for price reactions around daily high, low, and open levels for potential breakout or reversal opportunities.
Session-Based Strategies:
Focus on specific trading sessions for high-probability trades. Use session boxes to identify price ranges and key levels during those times.
Trend Confirmation:
Combine EMA200 and VWAP for a reliable trend-following strategy.
Volatility Assessment:
Observe the size of daily wicks and session ranges to understand market volatility and adjust your strategy accordingly.
This indicator is an essential tool for both intraday and swing traders, offering unparalleled insights into price action, session-specific volatility, and trend dynamics.
Number of Bars CheatSheetA regular trading day on the New York Stock Exchange (NYSE) consists of two main sessions: the Opening Auction and the Closing Auction, separated by a continuous trading session. Here's a breakdown of the trading day:
1. **Pre-Opening Session**: This session starts at 4:00 AM Eastern Time (ET) and lasts until 9:30 AM ET. During this time, there is limited trading activity, and orders can be entered and canceled. However, most of the trading activity doesn't occur until the regular trading session begins.
2. **Regular Trading Session**: The regular trading session on the NYSE starts at 9:30 AM ET and lasts until 4:00 PM ET. This is the primary trading session where the majority of price bars are formed.
3. **Closing Auction**: After the regular trading session ends at 4:00 PM ET, there is a closing auction period that typically lasts until 4:10 PM ET. During this time, there is a final price discovery process where orders are matched to determine the closing price for each security.
So, during the regular trading session, which is the main focus for most traders and investors, there are a total of 6.5 hours of trading. Trading occurs continuously during this time, with price bars being formed based on the time frame you're looking at. The most common time frames for price bars are one minute, five minutes, 15 minutes, 30 minutes, and one hour, among others. Therefore, the number of price bars in a regular trading day on the NYSE will depend on the time frame you are using for your analysis. For example, if you are using one-minute bars, there will be 6.5 x 60 = 390 price bars in a regular trading day.
Most-Crossed Channels (FAST • Top-K • Flexible Window)//@version=5
indicator("Most-Crossed Channels (FAST • Top-K • Flexible Window)", overlay=true, max_boxes_count=60, max_labels_count=60)
// ---------- Inputs ----------
windowMode = input.string(defval="Last N Bars", title="Scan Window", options= )
barsLookback = input.int(defval=800, title="If Last N Bars → how many?", minval=100, maxval=5000)
sess = input.session(defval="0830-1500", title="Session (exchange tz)")
sessionsBack = input.int(defval=1, title="If Last N Sessions → how many?", minval=1, maxval=10)
minutesLookback = input.int(defval=120, title="If Last X Minutes → how many?", minval=5, maxval=24*60)
sinceTs = input.time(defval=timestamp("2024-01-01T09:30:00"), title="Since time (chart tz)")
channelsK = input.int(defval=3, title="How many channels (Top-K)?", minval=1, maxval=10)
binTicks = input.int(defval=8, title="Bin width (ticks)", minval=1, maxval=200) // NQ tick=0.25; 8 ticks = 2.0 pts
minSepTicks = input.int(defval=12, title="Min separation between channels (ticks)", minval=1, maxval=500)
countSource = input.string(defval="Wick (H-L)", title="Count bars using", options= )
drawMode = input.string(defval="Use Candle", title="Draw channel as", options= )
anchorPart = input.string(defval="Body", title="If Use Candle → part", options= )
fixedTicks = input.int(defval=8, title="If Fixed Thickness → thickness (ticks)", minval=1, maxval=200)
extendBars = input.int(defval=400, title="Extend to right (bars)", minval=50, maxval=5000)
showLabels = input.bool(defval=true, title="Show labels with counts")
// ---------- Colors ----------
colFill = color.new(color.blue, 78)
colEdge = color.new(color.blue, 0)
colTxt = color.white
// ---------- Draw caches (never empty) ----------
var box g_boxes = array.new_box()
var label g_lbls = array.new_label()
// ---------- Helpers ----------
barsFromMinutes(mins, avgBarMs) =>
ms = mins * 60000.0
int(math.max(2, math.round(ms / nz(avgBarMs, 60000.0))))
// First (oldest) candle in whose selected part contains `level`
anchorIndexForPrice(level, useBody, scanNLocal) =>
idx = -1
for m = 1 to scanNLocal - 1
k = scanNLocal - m // oldest → newest
o = open
c = close
h = high
l = low
topZ = useBody ? math.max(o, c) : h
botZ = useBody ? math.min(o, c) : l
if level >= botZ and level <= topZ
idx := k
break
idx
// ---------- Window depth ----------
inSess = not na(time(timeframe.period, sess))
sessStartIdx = ta.valuewhen(inSess and not inSess , bar_index, 0)
sessStartIdxN = ta.valuewhen(inSess and not inSess , bar_index, sessionsBack - 1)
sinceStartIdx = ta.valuewhen(time >= sinceTs and time < sinceTs, bar_index, 0)
avgBarMs = ta.sma(time - time , 50)
depthRaw = switch windowMode
"Last N Bars" => barsLookback
"Today (session)" => bar_index - nz(sessStartIdx, bar_index)
"Last N Sessions" => bar_index - nz(sessStartIdxN, bar_index)
"Last X Minutes" => barsFromMinutes(minutesLookback, avgBarMs)
"Since time" => bar_index - nz(sinceStartIdx, bar_index)
avail = bar_index + 1
scanN = math.min(avail, math.max(2, depthRaw))
scanN := math.min(scanN, 2000) // performance cap
// ---------- Early guard ----------
if scanN < 2
na
else
// ---------- Build price histogram (O(N + B)) ----------
priceMin = 10e10
priceMax = -10e10
for j = 0 to scanN - 1
loB = math.min(open , close )
hiB = math.max(open , close )
lo = (countSource == "Body only") ? loB : low
hi = (countSource == "Body only") ? hiB : high
priceMin := math.min(priceMin, nz(lo, priceMin))
priceMax := math.max(priceMax, nz(hi, priceMax))
rng = priceMax - priceMin
tick = syminfo.mintick
binSize = tick * binTicks
if na(rng) or rng <= 0 or binSize <= 0
na
else
// Pre-allocate fixed-size arrays (never size 0)
MAX_BINS = 600
var float diff = array.new_float(MAX_BINS + 2, 0.0) // +2 so iH+1 is safe
var float counts = array.new_float(MAX_BINS + 1, 0.0)
var int blocked = array.new_int(MAX_BINS + 1, 0)
var int topIdx = array.new_int()
binsN = math.max(1, math.min(MAX_BINS, int(math.ceil(rng / binSize)) + 1))
// reset slices
for i = 0 to binsN + 1
array.set(diff, i, 0.0)
for i = 0 to binsN
array.set(counts, i, 0.0)
array.set(blocked, i, 0)
array.clear(topIdx)
// Range adds
for j = 0 to scanN - 1
loB = math.min(open , close )
hiB = math.max(open , close )
lo = (countSource == "Body only") ? loB : low
hi = (countSource == "Body only") ? hiB : high
iL = int(math.floor((lo - priceMin) / binSize))
iH = int(math.floor((hi - priceMin) / binSize))
iL := math.max(0, math.min(binsN - 1, iL))
iH := math.max(0, math.min(binsN - 1, iH))
array.set(diff, iL, array.get(diff, iL) + 1.0)
array.set(diff, iH + 1, array.get(diff, iH + 1) - 1.0)
// Prefix sum → counts
run = 0.0
for b = 0 to binsN - 1
run += array.get(diff, b)
array.set(counts, b, run)
// Top-K with spacing
sepBins = math.max(1, int(math.ceil(minSepTicks / binTicks)))
picks = math.min(channelsK, binsN)
if picks > 0
for _ = 0 to picks - 1
bestVal = -1e9
bestBin = -1
for b = 0 to binsN - 1
if array.get(blocked, b) == 0
v = array.get(counts, b)
if v > bestVal
bestVal := v
bestBin := b
if bestBin >= 0
array.push(topIdx, bestBin)
lB = math.max(0, bestBin - sepBins)
rB = math.min(binsN - 1, bestBin + sepBins)
for bb = lB to rB
array.set(blocked, bb, 1)
// Clear old drawings safely
while array.size(g_boxes) > 0
box.delete(array.pop(g_boxes))
while array.size(g_lbls) > 0
label.delete(array.pop(g_lbls))
// Draw Top-K channels
sz = array.size(topIdx)
if sz > 0
for t = 0 to sz - 1
b = array.get(topIdx, t)
level = priceMin + (b + 0.5) * binSize
useBody = (drawMode == "Use Candle")
anc = anchorIndexForPrice(level, useBody, scanN)
anc := anc == -1 ? scanN - 1 : anc
oA = open
cA = close
hA = high
lA = low
float topV = na
float botV = na
if drawMode == "Use Candle"
topV := (anchorPart == "Body") ? math.max(oA, cA) : hA
botV := (anchorPart == "Body") ? math.min(oA, cA) : lA
else
half = (fixedTicks * tick) * 0.5
topV := level + half
botV := level - half
left = bar_index - anc
right = bar_index + extendBars
bx = box.new(left, topV, right, botV, xloc=xloc.bar_index, bgcolor=colFill, border_color=colEdge, border_width=2)
array.push(g_boxes, bx)
if showLabels
txt = str.tostring(int(array.get(counts, b))) + " crosses"
lb = label.new(left, topV, txt, xloc=xloc.bar_index, style=label.style_label_down, textcolor=colTxt, color=colEdge)
array.push(g_lbls, lb)