ORB Strategy + Backtesting (fixed timestamp) - Lines Adjusted⚡ ORB Strategy + Backtesting (Pine Script v5)
This script implements a complete Opening Range Breakout (ORB) strategy, featuring built-in backtesting, advanced TP/SL visualization, full style customization, and a performance dashboard. It is designed for traders who want to clearly evaluate breakout performance directly on the chart.
🕑 ORB Window Configuration
🔹 Session selection: choose between Market Timezone or Custom Session.
🔹 Timezone support: configurable from UTC-8 to UTC+12.
🔹 Daily limit: option to allow only one trade per day.
🔹 Risk/Reward (RR) settings:
Configurable TP1, TP2, and TP3 levels.
Stop Loss calculated dynamically from the ORB range.
📊 Backtesting Engine
🔹 Interactive dashboard showing trades, wins, losses, and win rate.
🔹 Adjustable partial exits for each TP (TP1, TP2, TP3).
🔹 Automatic calculation of percentage-based profit and loss.
🔹 Tracks total trades, total profit, and average profit per trade.
🎨 Visual Customization
🔹 Fully customizable colors:
ORB high/low lines and range fill.
Buy/Sell entry labels.
TP and SL lines with background zones.
🔹 Line style and thickness options (solid, dotted, dashed).
🔹 Visibility controls for each TP/SL level.
🔹 Clear profit and loss zones drawn directly on the chart.
🚀 Trading Logic
🔹 LONG entries: triggered when price breaks above the ORB high.
🔹 SHORT entries: triggered when price breaks below the ORB low.
🔹 Automatic calculation of Stop Loss and TP1, TP2, TP3 based on ORB range and RR.
🔹 Customizable BUY / SELL labels displayed at entry.
✅ TP / SL Detection
🔹 Real-time detection of TP1, TP2, TP3, and SL hits.
🔹 Prevents double counting of the same level.
🔹 Extended TP/SL lines with shaded zones for better clarity.
📈 Backtesting Dashboard
🔹 Displayed in the top-right corner of the chart.
🔹 Shows:
Total trades
Wins / Losses
Win rate (%)
Total profit (%)
Average profit per trade
🔹 Fully customizable panel color.
✨ Summary
This script combines:
Opening Range detection
Breakout trading logic with advanced risk management
Professional-grade visualizations
Integrated historical performance tracking
High customization for sessions, styles, and colors
💡 Ideal for traders who want to trade ORB setups with clarity, structure, and measurable results.
Corak carta
MACD Trend Count ScoreThis indicator aims to confirm trends in an asset's price. This confirmation is achieved by counting the MACD bars in a calculation using the chosen timeframe. Positive and negative bars are considered in the calculation of the strength index, which indicates the current trend of that asset.
XAUUSD Levels (Sultan Plan)This indicator is a Monday trade-plan overlay for XAUUSD. It automatically marks your pre-defined Buy zones, Sell zone (scalp only), and the Invalidation level directly on the chart so you do not trade in the middle of consolidation.
It also shows EMA 50/200 for trend context and an RSI readout + mini dashboard (Bias, Confidence, current price zone, and invalidation) to keep execution disciplined.
The purpose is simple: wait for price to reach a zone, confirm reaction/rejection, then execute with risk management (TP1 → break-even, then trail).
O.R.B. New York (Opening Range)- Creates open range at New York Open (9:30am - 9:45am)
- Only shows most recent opening range for New York session (prevents clutter)
- Asset Classes: Micro Gold, Micro Silver, Micro ES, Micro NQ.
Unsurpassed Close LevelsThis indicator identifies and visually highlights previous candle close prices that have not yet been surpassed by any subsequent higher high — creating dynamic horizontal resistance levels based purely on closing prices.
How it works:
For every confirmed candle, a dashed horizontal ray is drawn from its close price extending to the right.
The ray remains visible as long as no future candle's high reaches or exceeds that previous close level.
As soon as price makes a new high that touches or surpasses the level, the ray is automatically removed.
Duplicate levels (exact same close price already active) are skipped to keep the chart clean.
A built-in limit of 50 active levels prevents overload on very long timeframes.
Use cases:
Spot potential resistance zones formed by previous closes that price has failed to reclaim on the upside.
Helpful in downtrends or ranging markets to visualize "overhead supply" levels where sellers previously stepped in at the close.
Great complement to traditional swing highs or supply/demand zones — focuses exclusively on close-based resistance.
Works on any timeframe and any instrument.
Visuals:
Dashed red horizontal rays extending right from unsurpassed closes.
Clean and lightweight — lines disappear automatically when invalidated.
Simple, effective, and fully automatic. No inputs required.
Feel free to customize the color, style, or max levels count in the code if desired.
Precision Trend ScalpingThis indicator is used specifically for heiken ashi candles. It indicates a reversal signal and only appears when a high volume doji candle forms and should develop in real time.
Low Volume Pullback DetectorThis script incorporates the logic of Volume Price Analysis (VPA), identifying potential trend continuations by detecting pullbacks with decreasing volume.
###**Features:**1. **Trend Filtering:** Uses a 50-period EMA to ensure trades align with the dominant market direction.
2. **Structure Identification:** Detects recent highs and lows to confirm that price action is indeed a pullback within a trend.
3. **Volume Analysis:** Checks if the volume during the pullback is below the 20-period average, signaling a lack of conviction from counter-trend traders.
4. **Signal Generation:** Triggers a "Buy" or "Sell" signal when price breaks out of the pullback range, confirming momentum is returning in the direction of the trend.
5. **User Guide:** Detailed comments explaining the strategy, setup, trade execution, and best markets are included directly within the script for easy reference.
###**How to Use:*** **Setup:** Apply the script to a chart (works best on Stocks and Futures).
* **Identify Trend:** Ensure price is above (for Buy) or below (for Sell) the gray 50 EMA line.
* **Wait for Signal:** Look for the **"VOL DRY"** label. This appears when a low-volume pullback is followed by a breakout candle.
* **Execution:** Enter on the close of the signal candle. Set your Stop Loss below/above the pullback swing and target the previous structural high/low.
JAM ORB Algo⚡ ORB Strategy + Backtesting (Pine Script v5)
This script implements a complete Opening Range Breakout (ORB) strategy, featuring built-in backtesting, advanced TP/SL visualization, full style customization, and a performance dashboard. It is designed for traders who want to clearly evaluate breakout performance directly on the chart.
🕑 ORB Window Configuration
🔹 Session selection: choose between Market Timezone or Custom Session.
🔹 Timezone support: configurable from UTC-8 to UTC+12.
🔹 Daily limit: option to allow only one trade per day.
🔹 Risk/Reward (RR) settings:
Configurable TP1, TP2, and TP3 levels.
Stop Loss calculated dynamically from the ORB range.
📊 Backtesting Engine
🔹 Interactive dashboard showing trades, wins, losses, and win rate.
🔹 Adjustable partial exits for each TP (TP1, TP2, TP3).
🔹 Automatic calculation of percentage-based profit and loss.
🔹 Tracks total trades, total profit, and average profit per trade.
🎨 Visual Customization
🔹 Fully customizable colors:
ORB high/low lines and range fill.
Buy/Sell entry labels.
TP and SL lines with background zones.
🔹 Line style and thickness options (solid, dotted, dashed).
🔹 Visibility controls for each TP/SL level.
🔹 Clear profit and loss zones drawn directly on the chart.
🚀 Trading Logic
🔹 LONG entries: triggered when price breaks above the ORB high.
🔹 SHORT entries: triggered when price breaks below the ORB low.
🔹 Automatic calculation of Stop Loss and TP1, TP2, TP3 based on ORB range and RR.
🔹 Customizable BUY / SELL labels displayed at entry.
✅ TP / SL Detection
🔹 Real-time detection of TP1, TP2, TP3, and SL hits.
🔹 Prevents double counting of the same level.
🔹 Extended TP/SL lines with shaded zones for better clarity.
📈 Backtesting Dashboard
🔹 Displayed in the top-right corner of the chart.
🔹 Shows:
Total trades
Wins / Losses
Win rate (%)
Total profit (%)
Average profit per trade
🔹 Fully customizable panel color.
✨ Summary
This script combines:
Opening Range detection
Breakout trading logic with advanced risk management
Professional-grade visualizations
Integrated historical performance tracking
High customization for sessions, styles, and colors
💡 Ideal for traders who want to trade ORB setups with clarity, structure, and measurable results.
Nuaing Trend Zone + Trade Guide PRO Multi TF + Structure Nuaing Trend Zone + Trade Guide PRO Multi TF + Structure
Buy Sell Strategy By Sultan Of Multan (Breakout/Retest)This is a comprehensive, all-in-one trading system designed for Forex, Crypto, and Stocks. It combines Smart Money Concepts (SMC), Trend Following, and Volatility Analysis into a single, easy-to-use toolkit.
Whether you are a scalper or a day trader, this indicator adapts to your style by allowing you to switch between Aggressive Breakouts and Conservative Retests.
🔥 Key Features:
1. Dual Entry Modes (New Update)
Breakout Mode: Get instant signals when price breaks market structure with momentum (BOS/CHoCH).
Retest Mode: The script waits for price to break and then pull back to the broken level before signaling. This reduces fake-outs and improves entry precision.
2. Smart Money Concepts (SMC)
Auto Fractals & Structure: Automatically detects BOS (Break of Structure) and CHoCH (Change of Character).
Fair Value Gaps (FVG): Detects 3-bar imbalances and alerts on midline taps.
Order Blocks (OB): Highlights valid bullish and bearish order blocks with trend alignment.
3. Trend & Bias Filters
EMA Stack & VWAP: Signals are only generated when the trend is aligned (Price > EMA200 & VWAP).
Multi-Timeframe Analysis: Optional HTF filter to ensure you are trading with the higher trend.
4. Advanced Confidence System
Score HUD: A smart panel that rates every signal (0-100) based on Volume (OBV), RSI, Liquidity, and Trend strength.
Volume Analysis: Integrated OBV slope and RVOL (Relative Volume) filters to confirm valid moves.
5. Complete Trade Management
ATR-Based TP/SL: Automatically calculates Stop Loss and Take Profit levels based on market volatility.
Unified Alerts: Get a single alert that includes Entry, SL, TP1, TP2, and Trade Analysis (Risk/Reward, Context) for easy automation.
Safe/Risky Panel: A dashboard that tells you if the last signal was "Safe" (high confidence) or "Risky".
🛠 How to Use:
Select Entry Method: Go to settings and choose "Breakout" for fast entries or "Retest" for safer entries.
Check the HUD: Look at the bottom center/right panels. Only take trades when the Score is Green/High and Volume is supportive.
Follow the Trend: The background color and VWAP line indicate the current market bias. Trade in the direction of the trend.
Disclaimer:
This tool is designed to assist your analysis, not to replace it. Always manage your risk and test on a demo account first.
MA 50/150 Status Light לקראת שנת 2026. בודק האם אנחנו נמצאים מעל ממוצע 150 ו 50 האם בין והאם מתחת
במידה ואנחנו מעל אז מצב המניה חזק
במידה ובין אז סימן אזהרה, החלשות המניה
במידה ומתחת אז מניה חלשה
“Heading into 2026, we check whether the price is above the 50-day and 150-day moving averages, between them, or below them.
If the price is above both, the stock is in a strong condition.
If the price is between them, it is a warning sign — the stock is weakening.
If the price is below both, the stock is weak.”
BOTMAN STRATEGYThis indicator is made and updated by SPXHERO.
This indicator is specialized in specific Stocks only:
QQQ
TSLA
AAPL
NVDA
MSFT
based on a new invented strategy and updated daily by us for your future use.
Smart Chart Patterns: Breakout Boxes## Abstract
This script is an algorithmic pattern recognition tool designed to identify, validate, and trade classical reversal structures (Double/Triple Tops and Bottoms). Unlike subjective drawing tools, this indicator employs a quantitative approach to geometry. It utilizes Volatility Normalization to ensure that angle detection works consistently across all asset classes—from high-priced assets like Bitcoin to low-volatility Forex pairs—without requiring manual recalibration.
## Methodology & Features
1. Pivot Chaining & Integrity Checks The algorithm identifies Swing Highs and Swing Lows (Pivots). It then "chains" them together to form resistance or support barriers.
Integrity Check: The script strictly enforces that price action between pivots must not violate the connecting line. If price cuts through the line, the pattern is invalidated immediately.
2. Angled vs. Horizontal Structures
Angled Mode: Allows for "channel-like" tops and bottoms (e.g., Rising Wedges or Descending Channels) up to a user-defined volatility-adjusted angle.
Horizontal Mode: If angled lines are disabled, the script applies a strict 1-degree tolerance filter, identifying only classical "Flat" Double/Triple patterns.
3. Trend Filtering To reduce false positives in ranging markets, the script includes a directional filter:
Double Tops are only validated if preceded by a quantitative Uptrend.
Double Bottoms are only validated if preceded by a quantitative Downtrend.
Trend Strength is measured by the net price displacement relative to ATR over a lookback period.
4. Automated Risk Management Upon pattern confirmation (breakout), the script automatically projects:
Target (Green): Projected based on the vertical height of the pattern (Pivot to Neckline).
Stop Loss (Red): Calculated dynamically using the Neckline ± (1.5 * ATR), adapting to current market volatility.
## Settings Guide
Min Touches: Set to 2 for Double patterns, 3 for Triple patterns.
Trend Filter: Enable to ensure the pattern is reversing an existing trend.
Angle Control: Adjusts the maximum allowed slope. Because this is normalized, 15.0 is a robust default for almost all assets.
Targets & Stops: Toggles the automated SL/TP lines and adjusts their multipliers.
XAUUSD Session Move Stats (Last 14 Days)This indicator analyzes Gold (XAUUSD) session behavior over the last 14 days and calculates how price typically moves during the Asia, London, and New York sessions.
For each session, it shows:
Average Max Up (%) – how far price moves up from session open
Average Max Down (%) – how far price moves down from session open
Average Net Close (%) – where price typically finishes relative to the session open
The data is calculated session-by-session and displayed in a table, helping traders understand session bias, volatility tendencies, and directional behavior.
Best used on intraday timeframes for session-based analysis and contextual trade planning (signals only, no automated trades).
HTF Fractal Candle OverlayHTF Fractal Candle Overlay is a technical visualization tool designed to display higher-timeframe candle structures directly on lower-timeframe charts.
In this script, fractal refers to the repetition and projection of higher-timeframe price structures across lower timeframes. By overlaying HTF candles onto the active chart, traders can observe how lower-timeframe price action evolves within larger timeframe candles, without switching timeframes or using multiple charts.
Core Functionality
• Projects selected higher-timeframe candles onto lower timeframes as a visual overlay
• Displays HTF candle bodies, wicks, opens, highs, lows, and midpoints
• Maintains accurate candle alignment using time-based calculations
• Supports session-aware and time-based candle segmentation
• Includes optional imbalance (FVG) and midpoint visualization
• Provides time-remaining tracking for active HTF candles
Fractal Concept Explained
The fractal behavior in this script is expressed through multi-timeframe structure repetition. Each higher-timeframe candle contains a sequence of lower-timeframe price movements that collectively form the same structural behavior. This overlay allows traders to study that relationship in real time and understand how HTF structure develops internally.
Use Cases
• Multi-timeframe context without timeframe switching
• Refining entries using HTF candle structure on LTF execution charts
• Studying internal candle behavior and volatility distribution
• Session-based structure analysis
• Educational visualization of HTF/LTF price relationships
Design Notes
• Built with performance-focused array management
• Automatically manages drawing lifecycle to prevent chart clutter
• Designed for clarity, not signal generation
• No repainting of completed HTF candles
This indicator is intended as a visual analysis tool, not a trading signal. It provides structural context to support discretionary decision-making based on price behavior.
Volatility High/Low Projection (PHOD / PLOD)AP Capital – Volatility + High/Low Projection
This indicator is designed to identify high-probability intraday turning points by combining daily range statistics, session behaviour, and volatility context into a single clean framework.
It is built for index, forex, and metals traders who want structure, not noise.
🔹 Core Features
1️⃣ Potential High of Day (PHOD) & Potential Low of Day (PLOD)
The indicator highlights likely intraday extremes based on:
Session timing (Asia, London, New York)
Current day volatility vs historical averages
Prior day expansion or compression behaviour
Each level is displayed with:
A clear label (PHOD / PLOD)
A forward-extending box acting as a live Point of Interest (POI)
Automatic invalidation when price breaks the zone
2️⃣ Volatility & Range Context (Info Panel)
A compact information panel in the top-right corner provides real-time context without cluttering the chart:
20-Day Average Range
% of the average range already used today
Range status (NORMAL / EXHAUSTED)
Average session ranges for:
Asia
London
New York
This allows traders to immediately assess whether price is:
Early in the day with room to trend
Statistically stretched and prone to reversal
Over-extended where breakout chasing is risky
3️⃣ Session-Aware Logic
The model respects how markets behave across the trading day:
Asia favours accumulation and potential lows
London provides expansion
New York often delivers distribution or exhaustion
This prevents random high/low marking and focuses only on structurally meaningful levels.
🧠 How to Use
Use PHOD / PLOD boxes as reaction zones, not blind entries
Combine with your own confirmation (structure break, momentum, volume, EMA reclaim, etc.)
Avoid chasing trades when the Range Status = EXHAUSTED
Particularly effective on 15m – 1h timeframes
⚠️ Important Notes
This indicator does not repaint
It is contextual, not a buy/sell signal generator
Best used as part of a complete trading plan
📈 Suitable Markets
XAUUSD (Gold)
Indices (NASDAQ, S&P 500, DAX)
Major FX pairs
📌 Disclaimer
This indicator is for educational and analytical purposes only.
It does not constitute financial advice. Trading involves risk.
Session Levels + PDH/PDL (Adjustable, v6 fixed) 📊 Session Levels + PDH/PDL (Adjustable)
This indicator plots key intraday reference levels based on major market sessions and the previous day’s range. It is designed for traders who rely on session highs/lows, liquidity levels, and market structure rather than indicators like EMAs or oscillators.
🔹 What it shows
Asia Session High & Low
UK (London) Session High & Low
New York Session High & Low
Previous Day High (PDH) & Previous Day Low (PDL)
Each level is drawn as a horizontal line and can optionally include a label for quick identification.
⚙️ Fully adjustable
Session times for Asia, UK, and New York are fully editable
Custom colors for each session and PDH/PDL
Show / hide toggles for each session individually
Adjustable line width and right-side extension
Optional session background shading with adjustable transparency
Optional labels for all levels
🕒 Timezone handling
Uses a user-defined timezone (default: Europe/Dublin)
Works on any intraday timeframe
Session logic is replay-safe and does not repaint past levels
🎯 How traders typically use it
Identify liquidity pools at session highs/lows
Use PDH/PDL as targets, reactions, or bias levels
Combine with price action, market structure, ORBs, or ICT-style models
Mark London and NY expansions after Asia range is set
✅ Designed for
Futures traders (ES, NQ, YM, Gold)
Forex and indices
Intraday & session-based strategies
Traders who want clean charts with meaningful levels only
Session Killzone & Liquidity Sweep Engine [2025]A session-based market analysis tool designed to visualize key intraday trading sessions and monitor price interaction with session highs and lows.
The script draws configurable session ranges (Asia, London, New York AM, Lunch, and PM) using session-based boxes. For each session, the high and low levels are calculated in real time and projected forward as reference levels.
Each session high and low reacts dynamically to price behavior:
• If price wicks beyond a session level without a candle close beyond it, the level is marked as a liquidity sweep and stops extending.
• If price closes beyond a session level, the level is considered invalidated and removed.
Optional midpoint levels can be displayed for each session. Users can choose whether levels extend only until mitigation or continue beyond it, as well as whether only the most recent session or all past sessions are tracked.
Additional features include:
• Timezone support with proper session alignment
• Session drawing limits to manage chart clutter
• Timeframe filtering to restrict drawings to lower timeframes
• Optional alerts when session highs or lows are broken by a candle close
• Extensive customization for colors, line styles, labels, and visibility
This tool is intended for traders who analyze intraday price behavior around session highs and lows and want a structured way to observe wick-based interactions and level invalidations.
HTF Liquidity Sweep EngineHTF Liquidity Sweep Detector (Dual HTF)
Overview
This indicator is designed to identify validated liquidity sweeps on Higher Timeframes (HTF) and project them accurately onto lower-timeframe charts.
Unlike basic sweep indicators that mark every high or low break, this tool applies context-aware validation and invalidation logic to distinguish meaningful liquidity events from random volatility.
The script supports two independent higher timeframes (HTF 1 & HTF 2), allowing traders to analyze liquidity hierarchy and confluence across multiple market structures within a single chart.
⸻
Core Concept
A liquidity sweep is not considered valid simply because price exceeds a previous high or low.
This script evaluates each sweep within the structural context of the HTF candle that formed it, accounting for:
• Bullish vs bearish candle structure
• Open, close, high, and low relationships
• Temporal sequencing between HTF candles
Sweeps are treated as stateful events with a full lifecycle rather than static lines.
⸻
Sweep Lifecycle & Invalidation Logic
Each detected sweep progresses through multiple states:
• Formation – A sweep is detected when price exceeds a prior HTF high or low under valid structural conditions.
• Validation – The sweep remains provisional until subsequent HTF candles confirm it.
• Invalidation – If later HTF price action violates the structural conditions, the sweep is automatically marked as invalidated.
• Removal – Sweeps that fail during their formation phase are removed entirely to avoid misleading signals.
This approach ensures that only structurally meaningful sweeps remain visible on the chart.
⸻
Dual Higher-Timeframe Analysis
HTF 1 and HTF 2 operate as separate liquidity layers, each with independent:
• Detection logic
• Validation and invalidation rules
• Visualization styles
This allows traders to identify:
• HTF liquidity alignment
• Higher-timeframe dominance
• Confluence or conflict between liquidity zones
⸻
Projection to Lower Timeframes
Detected HTF sweeps are dynamically projected onto the active chart timeframe.
Sweep levels update in real time and maintain accurate positioning relative to HTF candle boundaries, ensuring visual consistency across timeframes.
⸻
Valid Pullback Swing Line (Optional)
An optional internal swing structure module is included to identify valid pullback swings.
This feature tracks structural pivots, updates dynamically, and automatically invalidates broken swing structures, helping traders contextualize liquidity sweeps within current market structure.
⸻
Customization
Each HTF layer supports full independent customization:
• Enable / disable HTF layers
• Timeframe selection and lookback depth
• Sweep and invalidation line styles, colors, and widths
• Label and marker display options
• Label positioning and sizing
• Alert notifications for sweep formation
⸻
Alerts
Optional alerts trigger when a liquidity sweep is formed, allowing traders to monitor potential liquidity events without constant chart supervision.
⸻
This script is published as closed-source because its sweep validation, invalidation, and multi-timeframe interaction logic represents the core intellectual property of the tool.
The description above is intended to provide conceptual clarity without disclosing proprietary implementation details.
⸻
Intended Use
This indicator is designed as a market structure and liquidity analysis tool, not a standalone trading system.
It is best used in combination with price action, higher-timeframe bias, and risk management principles.
Navigator Volume Profil FixedLong Term Investing
Day Trading
Navigator Volume Profile Fixed (Fixed + Current Session)
**Navigator Volume Profile Fixed** plots a horizontal volume profile on your chart using a **fixed timeframe anchor** (ex: Daily) and optionally overlays a **live “current” profile** for the active session/period.
It’s designed to help you quickly see where volume is building (acceptance) vs. thinning out (rejection), and to identify the key reference levels traders watch most: **PoC, VAH, and VAL**.
### What it plots
**Fixed Volume Profile (anchored to a timeframe)**
Builds a completed profile each time the selected anchor timeframe rolls over (ex: each new day on a Daily anchor).
**Current Volume Profile (live)**
Continuously updates the developing profile for the current anchor period (optional toggle).
**Point of Control (PoC)**
Highlights the single price level with the highest traded volume.
**Value Area (VAH / VAL)**
Plots the Value Area boundaries using a configurable percentage (default **68%**), and visually differentiates the value area from the rest of the profile.
Key settings
* **Enable Fixed VP**: turn the fixed/anchored profile on/off
* **Timeframe Anchor**: choose the profile reset period (ex: 1D)
* **Show Current Fixed VP**: show/hide the developing (current) profile
* **Number of Rows**: controls profile resolution (price “bins”)
* **Profile Width (%)** and **Bar Thickness**: visual scaling controls
* **PoC + Value Area toggles**: show/hide PoC and VA boundaries
* **Extend PoC Line**: optionally extend the PoC into the future
How to use it (practical)
* Treat **PoC** as the most accepted price for the anchored period.
* Use **VAH/VAL** as reference boundaries for balance vs. imbalance.
* Compare **Fixed** vs **Current** profiles to see whether volume is migrating higher/lower during the session and where price is building acceptance.
**Note:** This script draws using TradingView line objects and is optimized to stay within platform limits while maintaining a clean profile display.
Double/Triple Tops & Bottoms & Rectangle BoxesThis indicator is an algorithmic pattern recognition tool designed to automatically identify, validate, and track significant reversal structures—specifically Double/Triple Tops and Bottoms. Unlike subjective drawing tools, this script uses a strict set of quantitative rules based on swing pivots and volatility (ATR) to define market structure.
The Logical Methodology The script operates on a three-stage "scientific" detection process:
Pivot Chaining (Level Detection): The algorithm scans for significant swing highs and lows using a user-defined lookback period. It stores these pivot levels and monitors subsequent price action. If price returns to a previous pivot level within a specific volatility threshold (normalized by ATR), it registers a "touch."
Pattern Construction (Neckline Identification): Once a level has been touched the required number of times (e.g., 2 for Double patterns, 3 for Triple patterns), the script calculates the "Neckline."
For Tops: It identifies the lowest trough between the peaks.
For Bottoms: It identifies the highest peak between the valleys. This creates a valid trading range, visualized as a blue box connecting the pivot level to the neckline.
Signal Validation (Breakout vs. Failure): The pattern remains in a "pending" state until a breakout occurs.
Confirmation: A signal is generated only when a candle closes beyond the neckline (below for Tops, above for Bottoms).
Invalidation: If price breaks the pivot level itself (e.g., makes a higher high on a Double Top) before breaking the neckline, the pattern is immediately marked invalid to prevent false signals.
Key Features
ATR-Based Sensitivity: Uses Average True Range to dynamically adjust how "precise" a re-test must be, adapting to changing market volatility.
Dual-Scanning: Can independently scan for Triple Tops (Bearish) and Double Bottoms (Bullish) simultaneously with separate settings.
Time & Width Constraints: Filters out "noise" by enforcing a minimum pattern width (in bars), ensuring only structurally significant patterns are displayed.
Settings Guide
Min Top/Bottom Touches: Set to 2 for Double patterns or 3 for Triple patterns.
Pivot Lookback: The number of bars used to define a swing point (higher = larger, more significant patterns).
Touch Sensitivity: Adjusts how strictly the price must match the previous level.
Min Pattern Width: Prevents the detection of micro-patterns that are too narrow to be reliable.
Top Detector V2 This indicator detects valid tops for future double tops. Once a top is confirmed, it displays an entry line for a potential entry point and a stop-loss line for a potential stop loss.
The indicator is fully programmable.






















