BOCS AdaptiveBOCS Adaptive Strategy - Automated Volatility Breakout System
WHAT THIS STRATEGY DOES:
This is an automated trading strategy that detects consolidation patterns through volatility analysis and executes trades when price breaks out of these channels. Take-profit and stop-loss levels are calculated dynamically using Average True Range (ATR) to adapt to current market volatility. The strategy closes positions partially at the first profit target and exits the remainder at the second target or stop loss.
TECHNICAL METHODOLOGY:
Price Normalization Process:
The strategy begins by normalizing price to create a consistent measurement scale. It calculates the highest high and lowest low over a user-defined lookback period (default 100 bars). The current close price is then normalized using the formula: (close - lowest_low) / (highest_high - lowest_low). This produces values between 0 and 1, allowing volatility analysis to work consistently across different instruments and price levels.
Volatility Detection:
A 14-period standard deviation is applied to the normalized price series. Standard deviation measures how much prices deviate from their average - higher values indicate volatility expansion, lower values indicate consolidation. The strategy uses ta.highestbars() and ta.lowestbars() functions to track when volatility reaches peaks and troughs over the detection length period (default 14 bars).
Channel Formation Logic:
When volatility crosses from a high level to a low level, this signals the beginning of a consolidation phase. The strategy records this moment using ta.crossover(upper, lower) and begins tracking the highest and lowest prices during the consolidation. These become the channel boundaries. The duration between the crossover and current bar must exceed 10 bars minimum to avoid false channels from brief volatility spikes. Channels are drawn using box objects with the recorded high/low boundaries.
Breakout Signal Generation:
Two detection modes are available:
Strong Closes Mode (default): Breakout occurs when the candle body midpoint math.avg(close, open) exceeds the channel boundary. This filters out wick-only breaks.
Any Touch Mode: Breakout occurs when the close price exceeds the boundary.
When price closes above the upper channel boundary, a bullish breakout signal generates. When price closes below the lower boundary, a bearish breakout signal generates. The channel is then removed from the chart.
ATR-Based Risk Management:
The strategy uses request.security() to fetch ATR values from a specified timeframe, which can differ from the chart timeframe. For example, on a 5-minute chart, you can use 1-minute ATR for more responsive calculations. The ATR is calculated using ta.atr(length) with a user-defined period (default 14).
Exit levels are calculated at the moment of breakout:
Long Entry Price = Upper channel boundary
Long TP1 = Entry + (ATR × TP1 Multiplier)
Long TP2 = Entry + (ATR × TP2 Multiplier)
Long SL = Entry - (ATR × SL Multiplier)
For short trades, the calculation inverts:
Short Entry Price = Lower channel boundary
Short TP1 = Entry - (ATR × TP1 Multiplier)
Short TP2 = Entry - (ATR × TP2 Multiplier)
Short SL = Entry + (ATR × SL Multiplier)
Trade Execution Logic:
When a breakout occurs, the strategy checks if trading hours filter is satisfied (if enabled) and if position size equals zero (no existing position). If volume confirmation is enabled, it also verifies that current volume exceeds 1.2 times the 20-period simple moving average.
If all conditions are met:
strategy.entry() opens a position using the user-defined number of contracts
strategy.exit() immediately places a stop loss order
The code monitors price against TP1 and TP2 levels on each bar
When price reaches TP1, strategy.close() closes the specified number of contracts (e.g., if you enter with 3 contracts and set TP1 close to 1, it closes 1 contract). When price reaches TP2, it closes all remaining contracts. If stop loss is hit first, the entire position exits via the strategy.exit() order.
Volume Analysis System:
The strategy uses ta.requestUpAndDownVolume(timeframe) to fetch up volume, down volume, and volume delta from a specified timeframe. Three display modes are available:
Volume Mode: Shows total volume as bars scaled relative to the 20-period average
Comparison Mode: Shows up volume and down volume as separate bars above/below the channel midline
Delta Mode: Shows net volume delta (up volume - down volume) as bars, positive values above midline, negative below
The volume confirmation logic compares breakout bar volume to the 20-period SMA. If volume ÷ average > 1.2, the breakout is classified as "confirmed." When volume confirmation is enabled in settings, only confirmed breakouts generate trades.
INPUT PARAMETERS:
Strategy Settings:
Number of Contracts: Fixed quantity to trade per signal (1-1000)
Require Volume Confirmation: Toggle to only trade signals with volume >120% of average
TP1 Close Contracts: Exact number of contracts to close at first target (1-1000)
Use Trading Hours Filter: Toggle to restrict trading to specified session
Trading Hours: Session input in HHMM-HHMM format (e.g., "0930-1600")
Main Settings:
Normalization Length: Lookback bars for high/low calculation (1-500, default 100)
Box Detection Length: Period for volatility peak/trough detection (1-100, default 14)
Strong Closes Only: Toggle between body midpoint vs close price for breakout detection
Nested Channels: Allow multiple overlapping channels vs single channel at a time
ATR TP/SL Settings:
ATR Timeframe: Source timeframe for ATR calculation (1, 5, 15, 60, etc.)
ATR Length: Smoothing period for ATR (1-100, default 14)
Take Profit 1 Multiplier: Distance from entry as multiple of ATR (0.1-10.0, default 2.0)
Take Profit 2 Multiplier: Distance from entry as multiple of ATR (0.1-10.0, default 3.0)
Stop Loss Multiplier: Distance from entry as multiple of ATR (0.1-10.0, default 1.0)
Enable Take Profit 2: Toggle second profit target on/off
VISUAL INDICATORS:
Channel boxes with semi-transparent fill showing consolidation zones
Green/red colored zones at channel boundaries indicating breakout areas
Volume bars displayed within channels using selected mode
TP/SL lines with labels showing both price level and distance in points
Entry signals marked with up/down triangles at breakout price
Strategy status table showing position, contracts, P&L, ATR values, and volume confirmation status
HOW TO USE:
For 2-Minute Scalping:
Set ATR Timeframe to "1" (1-minute), ATR Length to 12, TP1 Multiplier to 2.0, TP2 Multiplier to 3.0, SL Multiplier to 1.5. Enable volume confirmation and strong closes only. Use trading hours filter to avoid low-volume periods.
For 5-15 Minute Day Trading:
Set ATR Timeframe to match chart or use 5-minute, ATR Length to 14, TP1 Multiplier to 2.0, TP2 Multiplier to 3.5, SL Multiplier to 1.2. Volume confirmation recommended but optional.
For Hourly+ Swing Trading:
Set ATR Timeframe to 15-30 minute, ATR Length to 14-21, TP1 Multiplier to 2.5, TP2 Multiplier to 4.0, SL Multiplier to 1.5. Volume confirmation optional, nested channels can be enabled for multiple setups.
BACKTEST CONSIDERATIONS:
Strategy performs best during trending or volatility expansion phases
Consolidation-heavy or choppy markets produce more false signals
Shorter timeframes require wider stop loss multipliers due to noise
Commission and slippage significantly impact performance on sub-5-minute charts
Volume confirmation generally improves win rate but reduces trade frequency
ATR multipliers should be optimized for specific instrument characteristics
COMPATIBLE MARKETS:
Works on any instrument with price and volume data including forex pairs, stock indices, individual stocks, cryptocurrency, commodities, and futures contracts. Requires TradingView data feed that includes volume for volume confirmation features to function.
KNOWN LIMITATIONS:
Stop losses execute via strategy.exit() and may not fill at exact levels during gaps or extreme volatility
request.security() on lower timeframes requires higher-tier TradingView subscription
False breakouts inherent to breakout strategies cannot be completely eliminated
Performance varies significantly based on market regime (trending vs ranging)
Partial closing logic requires sufficient position size relative to TP1 close contracts setting
RISK DISCLOSURE:
Trading involves substantial risk of loss. Past performance of this or any strategy does not guarantee future results. This strategy is provided for educational purposes and automated backtesting. Thoroughly test on historical data and paper trade before risking real capital. Market conditions change and strategies that worked historically may fail in the future. Use appropriate position sizing and never risk more than you can afford to lose. Consider consulting a licensed financial advisor before making trading decisions.
ACKNOWLEDGMENT & CREDITS:
This strategy is built upon the channel detection methodology created by AlgoAlpha in the "Smart Money Breakout Channels" indicator. Full credit and appreciation to AlgoAlpha for pioneering the normalized volatility approach to identifying consolidation patterns and sharing this innovative technique with the TradingView community. The enhancements added to the original concept include automated trade execution, multi-timeframe ATR-based risk management, partial position closing by contract count, volume confirmation filtering, and real-time position monitoring.
Volatilitas
Uptrick: Volatility Weighted CloudIntroduction
The Volatility Weighted Cloud (VWC) is a trend-tracking overlay that combines adaptive volatility-based bands with a multi-source smoothed price cloud to visualize market bias. It provides users with a dynamic structure that adapts to volatility conditions while maintaining a persistent visual record of trend direction. By incorporating configurable smoothing techniques, percentile-ranked volatility, and multi-line cloud construction, the indicator allows traders to interpret price context more effectively without relying on raw price movement alone.
Overview
The script builds a smoothed price basis using the open, and close prices independently, and uses these to construct a layered visual cloud. This cloud serves both as a reference for price structure and a potential area of dynamic support and resistance. Alongside this cloud, adaptive upper and lower bands are plotted using volatility that scales with percentile rank. When price closes above or below these bands, the script interprets that as a breakout and updates the trend bias accordingly.
Candle coloring is persistent and reflects the most recent confirmed signal. Labels can optionally be placed on the chart when the trend bias flips, giving traders additional visual reference points. The indicator is designed to be both flexible and visually compact, supporting different strategies and timeframes through its detailed configuration options.
Originality
This script introduces originality through its combined use of percentile-ranked volatility, adaptive envelope sizing, and multi-source cloud construction. Unlike static-band indicators, the Volatility Weighted Cloud adjusts its band width based on where current volatility ranks within a defined lookback range. This dynamic scaling allows for smoother signal behavior during low-volatility environments and more responsive behavior during high-volatility phases.
Additionally, instead of using a single basis line, the indicator computes two separate smoothed lines for open and close. These are rendered into a shaded visual cloud that reflects price structure more completely than traditional moving average overlays. The use of ALMA and MAD, both less commonly applied in volatility-band overlays, adds further control over smoothing behavior and volatility measurement, enhancing its adaptability across different market types.
Inputs
Group: Core
Basis Length (short-term): The number of bars used for calculating the primary basis line. Affects how quickly the basis responds to price changes.
Basis Type: Option to choose between EMA and ALMA. EMA provides a standard exponential average; ALMA offers a centered, Gaussian-weighted average with reduced lag.
ALMA Offset: Determines the balance point of the ALMA window. Only applies when ALMA is selected.
Sigma: Sets the width of the ALMA smoothing window, influencing how much smoothing is applied.
Basis Smoothing EMA: Adds additional EMA-based smoothing to the computed basis line for noise reduction.
Group: Volatility & Bands
Volatility: Choose between StDev (standard deviation) and MAD (median absolute deviation) for measuring price volatility.
Vol Length (short-term): Length of the window used for calculating volatility.
Vol Smoothing EMA: Smooths the raw volatility value to stabilize band behavior.
Min Multiplier: Minimum multiplier applied to volatility when forming the adaptive bands.
Max Multiplier: Maximum multiplier applied at high volatility percentile.
Volatility Rank Lookback: Number of bars used to calculate the percentile rank of current volatility.
Show Adaptive Bands: Enables or disables the display of upper and lower volatility bands on the chart.
Group: Trend Switch Labels
Show Trend Switch Labels: Toggles the appearance of labels when the trend direction changes.
Label Anchor: Defines whether the labels are anchored to recent highs/lows or to the main basis line.
ATR Length (offset): Length used for calculating ATR, which determines label offset distance.
ATR Offset (multiplier): Multiplies the ATR value to place labels away from price bars for better visibility.
Label Size: Allows selection of label size (tiny to huge) to suit different chart setups.
Features
Adaptive Volatility Bands: The indicator calculates volatility using either standard deviation or MAD. It then applies an EMA smoothing layer and scales the band width dynamically based on the percentile rank of volatility over a user-defined lookback window. This avoids fixed-width bands and allows the indicator to adapt to changing volatility regimes in real time.
Volatility Method Options: Users can switch between two volatility measurement methods:
➤ Standard Deviation (StDev): Captures overall price dispersion, but may be sensitive to spikes.
➤ Median Absolute Deviation (MAD): A more robust measure that reduces the effect of outliers, making the bands less jumpy during erratic price behavior.
Basis Type Options: The core price basis used for cloud and bands can be built from:
➤ Exponential Moving Average (EMA): Fast-reacting and widely used in trend systems.
➤ Arnaud Legoux Moving Average (ALMA): A smoother, more centered alternative that offers greater control through offset and sigma parameters.
Multi-Line Basis Cloud: The cloud is formed by plotting two individually smoothed basis lines from open and close prices. A filled area is created between the open and close basis lines. This cloud serves as a dynamic support or resistance zone, allowing users to identify possible reversal areas. Price moving through or rejecting from the cloud can be interpreted contextually, especially when combined with band-based signals.
Persistent Trend Bias Coloring: The indicator uses the last confirmed breakout (above upper band or below lower band) to determine bias. This bias is reflected in the color of every subsequent candle, offering a persistent visual cue until a new signal is triggered. It helps simplify trend recognition, especially in choppy or sideways markets.
Trend Switch Labels: When enabled, the script places labeled markers at the exact bar where the bias direction switches. Labels are anchored either to recent highs/lows or to the main basis line, and spaced vertically using an ATR-based offset. This allows the trader to quickly locate historical trend transitions.
Alert Conditions: Two built-in alert conditions are available:
➤ Long Signal: Triggered when the close crosses above the upper adaptive band.
➤ Short Signal: Triggered when the close crosses below the lower adaptive band.
These conditions can be used for custom alerts, automation, or external signaling tools.
Display Control and Flexibility: Users can disable the adaptive bands for a cleaner layout while keeping the basis cloud and candle coloring active. The indicator can be tuned for fast or slow response depending on the strategy in use, and is suitable for intraday, swing, or position trading.
Summary
The Volatility Weighted Cloud is a configurable trend-following overlay that uses adaptive volatility bands and a structured cloud system to help visualize market bias. By combining EMA or ALMA smoothing with percentile-ranked volatility and a four-line price structure, it provides a flexible and informative charting layer. Its key strengths lie in the use of dynamic envelopes, visually persistent trend indication, and clearly defined breakout zones that adapt to current volatility conditions.
Disclaimer
This indicator is for informational and educational purposes only. Trading involves risk and may not be suitable for all investors. Past performance does not guarantee future results.
EMA Separation (LFZ Scalps) v6 — Early TriggerPlots the percentage distance between a fast and a slow EMA (default 9 & 21) to gauge trend strength and filter out choppy London Flow Zone breakouts.
• Gray – EMAs nearly flat (low momentum, avoid trades)
• Orange – early trend building
• Green/Red – strong directional momentum
Useful for day-traders: wait for the gap to widen beyond your chosen threshold (e.g., 0.25 %) before entering a breakout. Adjustable EMA lengths and alert when the separation exceeds your “strong trend” level.
Stop ATR [TheAlphaGroup]The Stop ATR is a volatility-based trailing stop that adapts dynamically to market conditions.
It uses the Average True Range (ATR) to plot a continuous “stair-step” line:
• In uptrend, the stop appears below price as a green line, rising with volatility.
• In downtrend, the stop appears above price as a red line, falling with volatility.
Unlike fixed stops, the Stop ATR never moves backward. It only trails in the direction of the trend, locking in profits while leaving room for price to move.
Key features:
• ATR-based trailing stop that adapts to volatility.
• Clean “one line only” design — no overlap of signals.
• Adjustable ATR period and multiplier for flexibility.
• Color-coded visualization for quick trend recognition.
How traders use it:
• Manage trades with volatility-adjusted stop placement (trailing stop).
• Identify trend reversals when price closes across the stop.
• Combine with other entry signals for a complete strategy.
Yasser Multiple Inside Bar Breakout SignalsDescription
Yasser Multiple Inside Bar Breakout Signals (Yasser_MIB) is a powerful TradingView indicator designed to detect high-probability breakout setups based on multiple inside bar (MIB) formations. Inside bar breakouts often precede strong market moves, making this tool ideal for traders who rely on price action, volatility compression, and breakout trading strategies.
🔑 Key Features:
✅ Automatic MIB Detection – Identifies and counts consecutive inside bars.
✅ Breakout Signals – Generates BUY/SELL signals upon valid breakout of the mother bar.
✅ Custom Risk:Reward Settings – Adjustable risk-to-reward ratio with built-in Stop Loss (SL) and Take Profit (TP) levels.
✅ ATR-based Stop Loss (Optional) – Dynamic volatility-based risk management.
✅ Trend Filter – Optional EMA filter to trade only in the trend direction.
✅ Visual Clarity – Mother bar levels, inside bar marks, entry/SL/TP lines, and breakout highlights.
✅ Alerts Ready – Receive instant alerts for MIB setups and breakouts.
This indicator is suitable for Forex, Stocks, Indices, Commodities, and Crypto markets across multiple timeframes. Whether you are a trend trader or a breakout trader, Yasser_MIB provides a structured approach to capture explosive market moves with disciplined risk management.
📂 Categories
Indicators
Technical Analysis
Price Action
Breakout Strategies
Risk Management
🏷 Tags
inside bar
multiple inside bar
MIB breakout
price action
mother bar
breakout strategy
trend filter
EMA filter
ATR stop loss
risk reward
forex trading
crypto trading
stocks
commodities
indices
Yasser indicators
Cycle-Synced Channel Breakout📌 Cycle-Synced Channel Breakout – Detect Breakouts Confirmed by Candles and Momentum Cycles
📖 Overview
The Cycle-Synced Channel Breakout indicator is a precision breakout detection tool that combines the power of:
• Adaptive Keltner Channels
• Dominant Cycle Period Analysis (Ehlers-inspired)
• Candlestick Pattern Recognition (Engulfing)
This multi-layered approach helps identify true breakout opportunities by filtering out noise and false signals, making it ideal for swing traders and intraday traders seeking high-probability directional moves.
⚙️ How It Works
1. Keltner Channel Envelope
A dynamic volatility channel based on the EMA and ATR defines the upper and lower bounds of price movement.
2. Engulfing Candle Detection
The script detects strong bullish and bearish engulfing patterns, which often signal trend reversals or momentum continuations.
3. Dominant Cycle Momentum (Ehlers-inspired)
Using a smoothed power oscillator derived from a detrended price series, the indicator assesses whether momentum is accelerating during the breakout — filtering out weak moves.
4. Signal Confirmation Logic
A signal is only shown when:
• An engulfing pattern is detected, and
• Price breaks out of the Keltner Channel, and
• Momentum (cycle power) is rising
5. Visual Feedback
• Breakout signals are plotted with “BUY” or “SELL” labels
• Faded green/red background highlights confirmed breakouts
• Optional display of engulfing candles with triangle markers
⸻
🛠️ Key Features
• ✅ Adaptive Keltner Channels
• ✅ Bullish/Bearish Engulfing Candle Recognition
• ✅ Ehlers-style Cycle Momentum Confirmation
• ✅ Background highlights for confirmed breakouts
• ✅ Optional candle pattern visualization
• ✅ Lightweight and Pine v6 compatible
⸻
🧪 Inputs
• Keltner Length – EMA period for channel basis
• Multiplier – Multiplied with ATR to determine band width
• Cycle Lookback – Used to calculate smoothed cycle power
• Show Engulfing Candles? – Toggles candlestick signals
• Show Breakout Signals? – Toggles breakout labels and backgrounds
⸻
🧠 How to Use
• Look for “BUY” or “SELL” labels when:
• An engulfing candle breaks through the Keltner Channel
• Cycle momentum confirms strength behind the move
• The background color will faintly highlight the breakout direction.
• Use in combination with other trend or volume indicators for added confluence.
🔒 Notes
• This indicator is not repainting.
• It is designed for educational and research purposes only.
• Works across all timeframes and asset classes (stocks, crypto, forex, etc.)
MACD (The Moving Average Convergence Divergence)The Moving Average Convergence Divergence (MACD) is a momentum indicator used in technical analysis to identify trends, measure their strength, and signal potential reversals. It is calculated by subtracting the 26-period Exponential Moving Average (EMA) from the 12-period EMA, creating the MACD line. A 9-period EMA of the MACD line, known as the signal line, is then plotted to generate buy or sell signals. Positive MACD values suggest upward momentum, while negative values indicate downward momentum. Traders often watch for crossovers, divergences, and movements relative to the zero line to make informed decisions.
Iron Condor Pro v6 – Full EngineIronCondor Engine v6.6 is a multi-mode options strategy tool for planning and managing iron condors, straddles, strangles, and butterflies. It supports both setup planning and live trade tracking with modeled delta, risk-based strike selection, IV rank estimation, and visual breach alerts.
Use Setup Mode to preview strike structures based on IV proxy, ATR, delta targeting, and risk tier (High/Mid/Low/Delta). Use Live Mode to track real trades, enter strike/premium data, and monitor live P&L, delta drift, and range status.
This script does not connect to live option chains. Volatility and delta are modeled using price history. All strikes and premiums must be confirmed using your broker before placing trades. Best used with strong support/resistance levels and high IV rank (30%+).
For educational purposes only.
Workflow Guide
Use this flow whether you're setting up on Sunday night or any day before placing a trade.
Step 0: Pre-Script Preparation
Before using the script:
Identify major support and resistance zones on your chart. Define the expected range or consolidation area. Use this context to help evaluate strike placement
1. Setup Phase (Pre-Trade Planning)
Step 1 – Load the Script
Add: IronCondor Engine v6.6 – Full Risk/Decay Edition to your chart
Step 2 – Set Mode = Setup
This enables planning mode, where the engine calculates strike combinations based on:
Your selected risk profile (High, Mid, Low, or Delta)
Historical volatility (20-day log return)
ATR (Average True Range)
Target short delta (adjustable)
Step 3 – Review Setup Table
Enable Show Setup Table to view calculated strikes and width by risk tier.
Adjust any of the following as needed:
Target Short Delta
Strike Interval ($)
Width multipliers (High/Mid/Low)
Risk tier under Auto-Feed Choice
Step 4 – Evaluate the Setup
Is the net credit at least 1.5–2.0x your max risk?
Are the short strikes clearly outside support/resistance zones?
Are the short deltas between 0.15 and 0.30?
Is the range wide enough to handle normal price movement?
Step 5 – Prep for Execution
Enable Auto-Feed Setup → Live to carry Setup strikes into Live mode
Or disable it if you prefer to manually enter strikes later
2. Trade Execution (Live Tracking Mode)
Step 1 – Place the Trade with Your Broker
Use your brokerage (TOS, Tasty, IBKR, etc.) to place the iron condor or other structure
Step 2 – Set Mode = Live
In Live mode:
If Auto-Feed is ON, the Setup strikes auto-populate
If Auto-Feed is OFF, manually enter:
Short and long strikes (Call and Put)
Premiums collected/paid per leg
Total net credit (Entry Credit)
Optional: Input current mid prices for each leg in the "Live Chain" section to track live mark-to-market P&L
Once all required fields are valid, the script activates:
Real-time profit/loss tracking
Max risk estimate
Delta monitoring on short legs
IV Rank estimate
Breach detection system
Chart visuals (if enabled)
3. Trade Management (During the Week)
While the trade is active, use the dashboard and visuals to monitor:
Key Metrics:
Unrealized P/L %
Mark-to-market value vs entry credit
Daily decay (theta)
Days until expiration
Breach status:
In Range
Near Breach
Breached
Alerts:
Price near short strike → suggests roll
Price breaches long strike → breach alert
50% or 75% profit → optional exit signal
Delta exceeds threshold → exposure may need adjustment
Management Tips:
At 50–75% profit: consider closing early
If price nears a short leg: roll, hedge, or manage
If nearing expiry: decide whether to hold or close
If IV collapses: may accelerate time decay or reduce exit value
4. End-of-Week or Expiration Management
If Profit Target Hit
Close early to reduce risk and lock gains
If Still Open Near Expiry
Close the position or
Hold through expiration only if you're fully prepared for pinning/gamma/assignment scenarios
Avoid holding open spreads over the weekend unless part of a defined strategy
Reference Notes
Strike Width
Defined as:
Width = Distance between Short and Long strike
Used for calculating max loss and breach visuals
Delta Guidelines
0.15–0.20 = safer, wider range, lower credit
0.25–0.30 = more aggressive, tighter range, higher credit
Use Target Short Delta input to adjust auto-selected strikes accordingly
Credit Example
Sell Call: $1.04
Sell Put: $0.23
Buy Call + Put wings: $0.14
Net Credit = $1.13 = $113 per contract (max profit)
This is the max profit if price stays between short strikes through expiration
IV Rank (Estimated)
This script does not use options chain IV data.
Instead, it calculates a volatility proxy:
ivRaw = ta.stdev(log returns, 20) * sqrt(252)
IV Rank is then calculated as the percentile of this value within the last 252 bars.
High IV Rank (30%–100%) → better premium-selling conditions
Low IV Rank (<30%) → lower edge for condors
Ideal to sell premium when IV Rank is above 30–50%
Disclosures and Limitations
This script is for educational use only
It does not connect to live option chains
All strikes, deltas, and premiums must be validated through your broker
Always confirm real-time IV, delta, and pricing before placing a trade
MYM Edge Booster MYM Long Trading Assistant - ATR-Based Edge Booster
Clean, simple indicator that tells you when MYM long setups meet high-probability criteria. No complicated charts - just clear numbers and signals.
• ATR Targets & Stops (whole numbers)
• Quality Score (0-3 stars)
• Green Circle when conditions perfect
• Warnings for choppy/high volatility
• ES/NQ sector confirmation
Eliminates guesswork. Trade when the green circle appears.
RCT FUSION PRO – Convergent Squeeze, Momentum & Trend SystemDescripción del script :
This indicator integrates three core technical concepts into a single decision-support framework: Bollinger-Keltner squeeze compression, directional trend strength (ADX/DMI), and multi-timeframe market wave momentum. The goal is not merely to overlay indicators, but to create a convergent signal system where confirmation across components increases the reliability of potential trade setups.
1. Squeeze Momentum (LazyBear’s method):
Detects periods of low volatility (squeeze) using Bollinger Bands inside Keltner Channels. When the squeeze “fires,” the linear regression-based oscillator (val) reveals the direction and acceleration of the breakout. Green/lime = bullish momentum; red/maroon = bearish.
2. Adaptive ADX & DMI Scaling:
The standard ADX (14-period) and +/-DI lines are dynamically scaled to match the amplitude of the squeeze oscillator. This allows traders to visually assess whether a breakout occurs alongside strong trend confirmation (ADX > 23) and directional bias (+DI > -DI or vice versa). The key level is offset by -7 units for better alignment.
3. Fibonacci Wave Momentum (A/B/C):
Three MACD-style histograms (Wave A: 55, Wave B: 144, Wave C: 233) use EMA crossovers with Fibonacci lengths to identify short-, medium-, and long-term momentum shifts. These appear as semi-transparent areas and help contextualize the squeeze signal within broader market cycles.
4. Divergence Detection (Non-repainting):
Automatically identifies regular and hidden bullish/bearish divergences between price and the squeeze oscillator. All divergence lines and labels are drawn only after the candle closes, preventing repainting. Alerts are included for all four divergence types.
How to use:
A squeeze release (black → gray background) combined with rising green histogram and +DI > -DI suggests a high-probability long setup.
Confirm with Wave A/B/C alignment (all turning positive) and/or a bullish divergence below zero.
Use the Key Level line (white) as a dynamic reference for ADX strength relative to momentum.
This system is designed for swing and intraday traders seeking confluence between volatility compression, trend strength, and cyclical momentum. No single component is traded in isolation—convergence is the core principle.
Versión en español :
Este indicador combina tres conceptos técnicos clave en un solo marco de apoyo a la decisión: compresión de squeeze (Bollinger-Keltner), fuerza direccional de tendencia (ADX/DMI) y momento de ondas de mercado en múltiples plazos. No se trata de una simple superposición, sino de un sistema donde la convergencia de señales aumenta la confiabilidad de las entradas.
El Squeeze Momentum detecta baja volatilidad y muestra la dirección del impulso tras la liberación.
El ADX y los DM+/- se escalan dinámicamente para alinearse visualmente con el oscilador, permitiendo evaluar si el impulso coincide con una tendencia fuerte.
Las Ondas A/B/C (55, 144, 233) muestran el momento en distintos horizontes temporales mediante áreas coloreadas.
Las divergencias (regulares y ocultas) se detectan sin repintado y generan alertas.
Se recomienda operar solo cuando múltiples componentes coinciden, no de forma aislada. Ideal para traders de swing e intradía que buscan confluencia.
BB Crosses Optimized - [JTCAPITAL]BB Crosses Optimized - is a modified way to use Bollinger Bands combined with volatility filtering (ATR) and flexible smoothing methods for Trend-Following.
The indicator works by calculating in the following steps:
Source Selection & Smoothing
The script begins by letting the user select a preferred price source (default is Close, but options include Open, High, Low, HL2, etc.). This raw input is then passed through a smoothing process.
Multiple smoothing techniques can be chosen: SMA, EMA, HMA, DEMA, TEMA, RMA, and FRAMA. Each method reduces short-term noise differently, ensuring flexibility for traders who prefer faster or slower reaction speeds in trend detection.
Bollinger Band Construction
Once the smoothed source is prepared, Bollinger Bands are calculated. The middle band is a moving average of the smoothed data over the defined BB Period . The upper and lower bands are then generated by adding and subtracting the Standard Deviation × Deviation multiplier . These dynamic bands capture volatility and help define breakout zones.
ATR Volatility Measurement
Parallel to the band calculation, the Average True Range (ATR) is computed over the chosen ATR Period . This measures market volatility. The ATR can optionally act as a filter, refining buy and sell levels so signals adapt to current market conditions rather than being fixed to price alone.
Bollinger Band Signals
-If the smoothed price closes above the upper band, a potential bullish event is marked.
-If the smoothed price closes below the lower band, a potential bearish event is marked.
Trend Line Construction
When a bullish event occurs, the script anchors a trend-following line beneath price. If ATR filtering is enabled, the line is set at Low – ATR , otherwise at the simple Low. Conversely, when a bearish event occurs, the line is anchored above price at High + ATR (or just High without the filter). The line is designed to only move in the direction of the trend—if price action does not exceed the prior value, the previous level is held. This prevents unnecessary whipsaws and keeps the indicator aligned with dominant momentum.
Final Trend Detection
The slope of the trend line defines the trend itself:
-Rising line → bullish trend.
-Falling line → bearish trend.
Visual Output
The indicator plots the trend line with dynamic coloring: Blue for bullish phases, Purple for bearish phases. A subtle filled background area emphasizes the active trend zone for clearer chart interpretation.
Buy and Sell Conditions:
- Buy Signal : Triggered when smoothed price closes above the upper Bollinger Band. Trend line then anchors below price (with or without ATR offset depending on settings).
- Sell Signal : Triggered when smoothed price closes below the lower Bollinger Band. Trend line then anchors above price (with or without ATR offset).
Additional filtering is possible via:
- ATR Toggle : Switch ATR on or off to adapt the strategy to either volatile or steady markets.
- Smoothing Method : Adjust smoothing to speed up or slow down responsiveness.
- Deviation Multiplier : Tight or wide bands adjust the sensitivity of signals.
Features and Parameters:
- Source : Choose between Close, Open, High, Low, HL2, etc.
- Average Type : Options include SMA, EMA, HMA, DEMA, TEMA, RMA, FRAMA.
- ATR Period : Defines how ATR volatility is measured.
- BB Period : Lookback length for Bollinger Band construction.
- Deviation : Multiplier for the standard deviation in Bollinger Bands.
- Smoothing Period : Controls how much the source data is smoothed.
- ATR Filter On/Off : Enables or disables ATR integration in signal calculation.
Specifications:
Smoothing (MA Types)
Smoothing is essential to reduce chart noise. By offering multiple MA choices, traders can balance between lag (SMA, RMA) and responsiveness (EMA, HMA, FRAMA). This flexibility allows the indicator to adapt across asset classes and trading styles.
Bollinger Bands
Bollinger Bands measure price deviation around a moving average. They help identify volatility expansion and contraction. In this script, the bands serve as breakout triggers—price crossing outside suggests momentum strong enough to sustain a trend.
Standard Deviation
Standard Deviation is a statistical measure that quantifies the dispersion of price data around the mean. With a multiplier applied, it creates bands that contain a probabilistic portion of price action. Crossing beyond these suggests a higher likelihood of trend continuation.
ATR (Average True Range)
ATR measures the degree of volatility. Instead of simply reacting to price crossing the bands, ATR ensures the trend line placement adapts to current conditions. In volatile markets, wider buffers prevent premature signals; in calmer markets, tighter placement keeps signals responsive.
Trend Line Logic
The trend line only adjusts in the direction of the trend. If new values do not exceed the prior, the line remains unchanged. This prevents false reversals and makes the line a reliable visual confirmation of trend direction.
Signal Detection
The indicator does not repaint: signals are based on confirmed closes relative to the Bollinger Bands. This makes it more reliable for both live trading and backtesting scenarios.
Visual Enhancements
The use of dual plots and fill shading creates a clearer separation of bullish vs. bearish phases. This helps traders visually align entries and exits without second-guessing.
Enjoy!
InsideBarPlus - Alpha GroupInside bar is a great strategy for prop firm evaluations. Since it's a short scalp.
In this version, the target and stops are ATR based.
The reason is that the volatility measurement on that specific moment, makes more sense to measure SL or TP sizing.
I hope you all enjoy. (Backtest it considering slippage, spreads and commissions), on higher timeframes the performance is better, since the spread size "becomes tiny".
Multi Indicator Screener# 📊 Multi-Indicator Screener | BB + KC Squeeze + RSI + MACD + ADX
### 🔹 Institutional-Grade Multi-Symbol Scanner with Breakout Alerts
---
## 📌 Overview
The **Multi-Indicator Screener** is an advanced dashboard that monitors **10 symbols simultaneously** with **multi-indicator confluence**:
- 🔹 **Bollinger Bands + Keltner Channel (Squeeze Logic)**
- 🔹 **RSI + MACD Confirmation**
- 🔹 **ADX Trend Strength**
- 🔹 **ATR-based Trailing Stops**
- 🔹 **Volume-Confirmed Breakouts**
Designed for **professional traders**, this screener highlights **high-probability setups** across multiple assets in real time.
---
## ✨ Key Features
### 🔹 Bollinger Band Suite
- ✅ Detects **directional bias** (Bullish / Bearish / Neutral).
- ✅ Marks **Breakouts (Up/Down)** with optional **volume confirmation**.
- ✅ LazyBear-style **Squeeze Detection**:
- 🔒 Squeeze ON → Low volatility, contraction phase.
- 🚀 Squeeze OFF → Breakout potential.
- Neutral → No clear squeeze.
### 🔹 RSI + MACD Confluence
- ✅ RSI confirmation above user-defined threshold (default 55).
- ✅ MACD crossover confirmation.
- ✅ RSI value color-coded in table:
- 🔴 Oversold (<30)
- 🟢 Strong bullish (>60)
- 🟢 Lime (>75 = very strong)
- 🟠 Neutral zone
### 🔹 ADX Trend Strength
- ✅ Displays **ADX value**, plus **+DI / -DI**.
- ✅ ADX > 25 → Highlighted as strong trend.
### 🔹 ATR Trailing Stop Loss
- ✅ Auto-calculated **buy-side trailing stop** & **sell-side trailing stop**.
- ✅ Adjustable via multiplier input.
### 🔹 Multi-Symbol Screener Table
- ✅ Preloaded with **Top 10 Nifty 50 symbols** (customizable).
- ✅ Dashboard columns include:
- Symbol
- BB Direction
- Breakout
- Squeeze Status
- Higher-TF BB Confirmation
- RSI + MACD Signals
- RSI Value
- ADX, +DI, -DI
- Trailing SL (Buy/Sell)
- Volume Confirmation
---
## 🔔 Alerts
Each symbol has **independent breakout alerts**:
- 📢 `Volume-Confirmed BB Breakout Detected`
Alerts fire when a **breakout above/below Bollinger Bands** is confirmed with **above-average volume**.
---
## 📖 How to Use
1. **Select Symbols**
- By default, loads top Nifty 50 stocks.
- Replace with your preferred tickers (`NSE:RELIANCE`, `NASDAQ:AAPL`, `BINANCE:BTCUSDT`, etc.).
2. **Enable Presets**
- **Scalping Mode** → BB Length = 10, Multiplier = 1.5 (more sensitive).
- **Swing Mode** → BB Length = 30, Multiplier = 2.5 (smoother).
3. **Monitor Table**
- Look for **✔️ confirmations** across BB, RSI, MACD, ADX, and Volume.
- Strong setups = multiple confirmations aligning.
4. **Set Alerts**
- Add alerts for your desired symbols to never miss a breakout.
---
## 🎯 Best For
- ✅ Scalpers & Swing Traders
- ✅ Multi-asset monitoring (stocks, forex, crypto)
- ✅ Traders using **volatility breakout + momentum confirmation**
- ✅ Institutional-style dashboard users
---
## ⚠️ Disclaimer
This script is for **educational purposes only**.
It is **not financial advice**. Please backtest before trading.
---
Guided Advisor with DXY ContextThis indicator will constantly will be looking for DXY direction in the background.
Morning Peak FadeMorning Peak Fade is an intraday analysis tool that identifies and measures the probability of early session rallies turning into sharp pullbacks.
📊 Core Idea
• Many stocks surge after the open, reaching an intraday peak before fading lower.
• This script anchors at the first significant morning high and tracks the drawdowns that follow within a customizable time window.
• It provides:
• Probability of a fade after the peak
• Average and maximum drawdown statistics
• Event-day hit rate (how often such setups occur)
🎯 Use Cases
• Spot potential “fade setups” where early enthusiasm exhausts quickly.
• Quantify how often chasing the morning high turns into a losing trade.
• Backtest opening range failure or fade strategies with hard data.
⚙️ Features
• Customizable thresholds for the initial surge (relative to prior close).
• Marks the peak (max) and subsequent low (min) used in calculations.
• Draws a reference line at the surge threshold to visualize when the fade triggers.
• Outputs summary stats directly on the chart.
NY Open OR/ATR Diff Planner – v2.8 NY Open OR/ATR Diff Planner – v2.8 (Hi-Contrast)
Trade the Opening Range Breakout with a plan, not vibes.
This tool builds the NY Opening Range (OR) from the cash open and overlays a complete, risk-based execution plan: precise entry, structural stop, position size, targets, and R:R — all tied to the Daily ATR(14) and the remaining ATR “fuel” left in the day.
What it does
Opening Range: First N minutes after 09:30 ET (choose 5/15/30/60).
Today-only lines: Automatically resets at 09:30; no carry-over from prior days.
Session aware: Works on RTH or ETH charts. OR always anchors at 09:30 ET.
Fuel model: Computes Session Range (since 09:30) and ATR Diff Left = Daily ATR − Session Range.
Entries & Stops:
Long plan: Entry = ORH, Stop = ORL
Short plan: Entry = ORL, Stop = ORH
Targets:
TP1 = 1R (distance of entry→stop)
TP (ATR-diff cap): Entry ± ATR Diff Left (caps greed when the day’s ATR is nearly spent)
Sizing & R:R: Position size = Account × Risk% / Risk per share, with live R:R to ATR-diff target.
Hi-contrast table: Clear readout of Daily ATR, OR size, OR/ATR%, Session Range, ATR left, entries/stops/TPs, size, and max $ risk.
Inputs
Opening Range (minutes): 5 / 15 / 30 / 60
Account Size ($) and Risk % per trade
Session mode: RTH (09:30–16:00) or ETH (chart’s session; still anchored at 09:30)
Also show Short plan (toggle)
Show info table (toggle)
How to use
Add on a 1–5m chart.
Choose your OR window (e.g., 15m = 09:30–09:45).
Set Account Size and Risk % (e.g., 4–5% for small accounts; adjust to taste).
Wait for the OR to complete.
Trade the break/retest with the levels shown:
Long: Break of ORH, SL at ORL, TP1 = 1R, TP2 = ATR-diff cap.
Short: Mirror logic.
If OR/ATR% > ~50% (red), the “fuel” is thin — be selective.
Why it helps build an edge
Objective structure: Clear levels and sizing remove guesswork.
Context-aware targets: ATR-diff keeps targets realistic to the day’s potential.
Discipline by design: One framework that’s easy to review, journal, and iterate.
Notes
This is an indicator (visual planner), not an order-placing strategy.
If you want a back testable version (one trade/day, optional retest rule, TP/SL logic), say the word — I can publish a strategy variant.
Keywords: ORB, Opening Range, ATR, Risk Management, Position Sizing, Day Trading, NYSE Open, Mean Reversion Fuel, Execution Planner
MajorTop DeltaVol ma5-52wThe idea is to identify major tops on the weekly when both are above 0 at the same time; to look just for mkt tops.
Major tops use to drag on for a little with increasing volatility before crashing.
green is 5-52sma
fuchsia 3-9sma
Sma are on the candle's range ratio on the close.
H/L Swings/pivots detectorThis indicator detects and labels swing highs and swing lows using pivot logic.
It highlights market structure shifts by identifying:
- Higher Highs (HH) and Lower Highs (LH)
- Lower Lows (LL) and Higher Lows (HL)
Traders often use these levels to analyze trends, reversals, and key support/resistance zones.
The script also plots pivot markers above highs and below lows for visual clarity.
This tool is designed for educational and analytical purposes, and it does not provide financial advice or guaranteed results.
📂 Categories (choose when publishing)
Type of script → Indicator
Category → Trend Analysis (fits best for HH/LL pivots)
Optionally → Support/Resistance (if you emphasize pivots as zones)
swing high
swing low
pivot points
market structure
trend analysis
higher high
lower low
support resistance
Daily ATR TrackerThis indicator calculates the daily ATR of the past 14 days. The ATR% indicates the range completed for the day. The ATR indicates the average daily range. The 20% ATR indicates the value of 20% of the daily ATR for retracement purposes.
Premarket Power MovePremarket Power Move is an intraday research tool that tracks what happens after strong premarket or opening gaps.
📊 Core Idea
• When a stock opens +X% above the prior close, it often attracts momentum traders.
• This script measures whether the stock continues to follow through higher or instead fades back down within the first trading hour.
• It calculates:
• The probability of a post-gap rally vs. a drawdown
• Average and maximum retracements after the surge
• Event-day hit rate (how many days actually triggered the condition)
🎯 Use Cases
• Identify “gap-and-go” opportunities where strong premarket strength leads to further gains.
• Spot potential fade setups where early enthusiasm quickly reverses.
• Backtest your intraday strategies with objective statistics instead of gut feeling.
⚙️ Features
• Customizable thresholds for premarket/open surge (%) and follow-through window (minutes).
• Marks the chart with reference lines:
• Prior close
• Surge threshold (e.g. +6%)
• Intraday high/low used for probability calculations.
• Outputs summary statistics (probabilities, averages, counts) directly on the chart.
🔔 Note
This is not a buy/sell signal generator. It is a probability and behavior analysis tool that helps traders understand how often strong premarket gaps continue vs. fade.
RSI(7) + MACD ZoneTitle: RSI(7) + MACD Zone Combo
Description:
This indicator combines RSI (7) and MACD (12,26,9) into a single panel with a unified scale for easier analysis.
RSI (7) is plotted in white and automatically turns red when the market reaches overbought (>70) or oversold (<30) conditions.
MACD is normalized to align with the RSI scale (0–100).
A value of 50 represents MACD = 0.
Above 50 (teal) indicates positive momentum.
Below 50 (red) indicates negative momentum.
This combination allows traders to quickly identify when short-term RSI conditions align with overall momentum shifts from MACD.
How to use:
Look for potential buy opportunities when RSI is oversold (<30) and MACD is above 50 (positive momentum).
Look for potential sell opportunities when RSI is overbought (>70) and MACD is below 50 (negative momentum).
Use in conjunction with price action and risk management — not as a standalone signal.
BOCS Channel Scalper Indicator - Mean Reversion Alert System# BOCS Channel Scalper Indicator - Mean Reversion Alert System
## WHAT THIS INDICATOR DOES:
This is a mean reversion trading indicator that identifies consolidation channels through volatility analysis and generates alert signals when price enters entry zones near channel boundaries. **This indicator version is designed for manual trading with comprehensive alert functionality.** Unlike automated strategies, this tool sends notifications (via popup, email, SMS, or webhook) when trading opportunities occur, allowing you to manually review and execute trades. The system assumes price will revert to the channel mean, identifying scalp opportunities as price reaches extremes and preparing to bounce back toward center.
## INDICATOR VS STRATEGY - KEY DISTINCTION:
**This is an INDICATOR with alerts, not an automated strategy.** It does not execute trades automatically. Instead, it:
- Displays visual signals on your chart when entry conditions are met
- Sends customizable alerts to your device/email when opportunities arise
- Shows TP/SL levels for reference but does not place orders
- Requires you to manually enter and exit positions based on signals
- Works with all TradingView subscription levels (alerts included on all plans)
**For automated trading with backtesting**, use the strategy version. For manual control with notifications, use this indicator version.
## ALERT CAPABILITIES:
This indicator includes four distinct alert conditions that can be configured independently:
**1. New Channel Formation Alert**
- Triggers when a fresh BOCS channel is identified
- Message: "New BOCS channel formed - potential scalp setup ready"
- Use this to prepare for upcoming trading opportunities
**2. Long Scalp Entry Alert**
- Fires when price touches the long entry zone
- Message includes current price, calculated TP, and SL levels
- Notification example: "LONG scalp signal at 24731.75 | TP: 24743.2 | SL: 24716.5"
**3. Short Scalp Entry Alert**
- Fires when price touches the short entry zone
- Message includes current price, calculated TP, and SL levels
- Notification example: "SHORT scalp signal at 24747.50 | TP: 24735.0 | SL: 24762.75"
**4. Any Entry Signal Alert**
- Combined alert for both long and short entries
- Use this if you want a single alert stream for all opportunities
- Message: "BOCS Scalp Entry: at "
**Setting Up Alerts:**
1. Add indicator to chart and configure settings
2. Click the Alert (⏰) button in TradingView toolbar
3. Select "BOCS Channel Scalper" from condition dropdown
4. Choose desired alert type (Long, Short, Any, or Channel Formation)
5. Set "Once Per Bar Close" to avoid false signals during bar formation
6. Configure delivery method (popup, email, webhook for automation platforms)
7. Save alert - it will fire automatically when conditions are met
**Alert Message Placeholders:**
Alerts use TradingView's dynamic placeholder system:
- {{ticker}} = Symbol name (e.g., NQ1!)
- {{close}} = Current price at signal
- {{plot_1}} = Calculated take profit level
- {{plot_2}} = Calculated stop loss level
These placeholders populate automatically, creating detailed notification messages without manual configuration.
## KEY DIFFERENCE FROM ORIGINAL BOCS:
**This indicator is designed for traders seeking higher trade frequency.** The original BOCS indicator trades breakouts OUTSIDE channels, waiting for price to escape consolidation before entering. This scalper version trades mean reversion INSIDE channels, entering when price reaches channel extremes and betting on a bounce back to center. The result is significantly more trading opportunities:
- **Original BOCS**: 1-3 signals per channel (only on breakout)
- **Scalper Indicator**: 5-15+ signals per channel (every touch of entry zones)
- **Trade Style**: Mean reversion vs trend following
- **Hold Time**: Seconds to minutes vs minutes to hours
- **Best Markets**: Ranging/choppy conditions vs trending breakouts
This makes the indicator ideal for active day traders who want continuous alert opportunities within consolidation zones rather than waiting for breakout confirmation. However, increased signal frequency also means higher potential commission costs and requires disciplined trade selection when acting on alerts.
## TECHNICAL METHODOLOGY:
### Price Normalization Process:
The indicator normalizes price data to create consistent volatility measurements across different instruments and price levels. It calculates the highest high and lowest low over a user-defined lookback period (default 100 bars). Current close price is normalized using: (close - lowest_low) / (highest_high - lowest_low), producing values between 0 and 1 for standardized volatility analysis.
### Volatility Detection:
A 14-period standard deviation is applied to the normalized price series to measure price deviation from the mean. Higher standard deviation values indicate volatility expansion; lower values indicate consolidation. The indicator uses ta.highestbars() and ta.lowestbars() to identify when volatility peaks and troughs occur over the detection period (default 14 bars).
### Channel Formation Logic:
When volatility crosses from a high level to a low level (ta.crossover(upper, lower)), a consolidation phase begins. The indicator tracks the highest and lowest prices during this period, which become the channel boundaries. Minimum duration of 10+ bars is required to filter out brief volatility spikes. Channels are rendered as box objects with defined upper and lower boundaries, with colored zones indicating entry areas.
### Entry Signal Generation:
The indicator uses immediate touch-based entry logic. Entry zones are defined as a percentage from channel edges (default 20%):
- **Long Entry Zone**: Bottom 20% of channel (bottomBound + channelRange × 0.2)
- **Short Entry Zone**: Top 20% of channel (topBound - channelRange × 0.2)
Long signals trigger when candle low touches or enters the long entry zone. Short signals trigger when candle high touches or enters the short entry zone. Visual markers (arrows and labels) appear on chart, and configured alerts fire immediately.
### Cooldown Filter:
An optional cooldown period (measured in bars) prevents alert spam by enforcing minimum spacing between consecutive signals. If cooldown is set to 3 bars, no new long alert will fire until 3 bars after the previous long signal. Long and short cooldowns are tracked independently, allowing both directions to signal within the same period.
### ATR Volatility Filter:
The indicator includes a multi-timeframe ATR filter to avoid alerts during low-volatility conditions. Using request.security(), it fetches ATR values from a specified timeframe (e.g., 1-minute ATR while viewing 5-minute charts). The filter compares current ATR to a user-defined minimum threshold:
- If ATR ≥ threshold: Alerts enabled
- If ATR < threshold: No alerts fire
This prevents notifications during dead zones where mean reversion is unreliable due to insufficient price movement. The ATR status is displayed in the info table with visual confirmation (✓ or ✗).
### Take Profit Calculation:
Two TP methods are available:
**Fixed Points Mode**:
- Long TP = Entry + (TP_Ticks × syminfo.mintick)
- Short TP = Entry - (TP_Ticks × syminfo.mintick)
**Channel Percentage Mode**:
- Long TP = Entry + (ChannelRange × TP_Percent)
- Short TP = Entry - (ChannelRange × TP_Percent)
Default 50% targets the channel midline, a natural mean reversion target. These levels are displayed as visual lines with labels and included in alert messages for reference when manually placing orders.
### Stop Loss Placement:
Stop losses are calculated just outside the channel boundary by a user-defined tick offset:
- Long SL = ChannelBottom - (SL_Offset_Ticks × syminfo.mintick)
- Short SL = ChannelTop + (SL_Offset_Ticks × syminfo.mintick)
This logic assumes channel breaks invalidate the mean reversion thesis. SL levels are displayed on chart and included in alert notifications as suggested stop placement.
### Channel Breakout Management:
Channels are removed when price closes more than 10 ticks outside boundaries. This tolerance prevents premature channel deletion from minor breaks or wicks, allowing the mean reversion setup to persist through small boundary violations.
## INPUT PARAMETERS:
### Channel Settings:
- **Nested Channels**: Allow multiple overlapping channels vs single channel
- **Normalization Length**: Lookback for high/low calculation (1-500, default 100)
- **Box Detection Length**: Period for volatility detection (1-100, default 14)
### Scalping Settings:
- **Enable Long Scalps**: Toggle long alert generation on/off
- **Enable Short Scalps**: Toggle short alert generation on/off
- **Entry Zone % from Edge**: Size of entry zone (5-50%, default 20%)
- **SL Offset (Ticks)**: Distance beyond channel for stop (1+, default 5)
- **Cooldown Period (Bars)**: Minimum spacing between alerts (0 = no cooldown)
### ATR Filter:
- **Enable ATR Filter**: Toggle volatility filter on/off
- **ATR Timeframe**: Source timeframe for ATR (1, 5, 15, 60 min, etc.)
- **ATR Length**: Smoothing period (1-100, default 14)
- **Min ATR Value**: Threshold for alert enablement (0.1+, default 10.0)
### Take Profit Settings:
- **TP Method**: Choose Fixed Points or % of Channel
- **TP Fixed (Ticks)**: Static distance in ticks (1+, default 30)
- **TP % of Channel**: Dynamic target as channel percentage (10-100%, default 50%)
### Appearance:
- **Show Entry Zones**: Toggle zone labels on channels
- **Show Info Table**: Display real-time indicator status
- **Table Position**: Corner placement (Top Left/Right, Bottom Left/Right)
- **Long Color**: Customize long signal color (default: darker green for readability)
- **Short Color**: Customize short signal color (default: red)
- **TP/SL Colors**: Customize take profit and stop loss line colors
- **Line Length**: Visual length of TP/SL reference lines (5-200 bars)
## VISUAL INDICATORS:
- **Channel boxes** with semi-transparent fill showing consolidation zones
- **Colored entry zones** labeled "LONG ZONE ▲" and "SHORT ZONE ▼"
- **Entry signal arrows** below/above bars marking long/short alerts
- **TP/SL reference lines** with emoji labels (⊕ Entry, 🎯 TP, 🛑 SL)
- **Info table** showing channel status, last signal, entry/TP/SL prices, risk/reward ratio, and ATR filter status
- **Visual confirmation** when alerts fire via on-chart markers synchronized with notifications
## HOW TO USE:
### For 1-3 Minute Scalping with Alerts (NQ/ES):
- ATR Timeframe: "1" (1-minute)
- ATR Min Value: 10.0 (for NQ), adjust per instrument
- Entry Zone %: 20-25%
- TP Method: Fixed Points, 20-40 ticks
- SL Offset: 5-10 ticks
- Cooldown: 2-3 bars to reduce alert spam
- **Alert Setup**: Configure "Any Entry Signal" for combined long/short notifications
- **Execution**: When alert fires, verify chart visuals, then manually place limit order at entry zone with provided TP/SL levels
### For 5-15 Minute Day Trading with Alerts:
- ATR Timeframe: "5" or match chart
- ATR Min Value: Adjust to instrument (test 8-15 for NQ)
- Entry Zone %: 20-30%
- TP Method: % of Channel, 40-60%
- SL Offset: 5-10 ticks
- Cooldown: 3-5 bars
- **Alert Setup**: Configure separate "Long Scalp Entry" and "Short Scalp Entry" alerts if you trade directionally based on bias
- **Execution**: Review channel structure on alert, confirm ATR filter shows ✓, then enter manually
### For 30-60 Minute Swing Scalping with Alerts:
- ATR Timeframe: "15" or "30"
- ATR Min Value: Lower threshold for broader market
- Entry Zone %: 25-35%
- TP Method: % of Channel, 50-70%
- SL Offset: 10-15 ticks
- Cooldown: 5+ bars or disable
- **Alert Setup**: Use "New Channel Formation" to prepare for setups, then "Any Entry Signal" for execution alerts
- **Execution**: Larger timeframes allow more analysis time between alert and entry
### Webhook Integration for Semi-Automation:
- Configure alert webhook URL to connect with platforms like TradersPost, TradingView Paper Trading, or custom automation
- Alert message includes all necessary order parameters (direction, entry, TP, SL)
- Webhook receives structured data when signal fires
- External platform can auto-execute based on alert payload
- Still maintains manual oversight vs full strategy automation
## USAGE CONSIDERATIONS:
- **Manual Discipline Required**: Alerts provide opportunities but execution requires judgment. Not all alerts should be taken - consider market context, trend, and channel quality
- **Alert Timing**: Alerts fire on bar close by default. Ensure "Once Per Bar Close" is selected to avoid false signals during bar formation
- **Notification Delivery**: Mobile/email alerts may have 1-3 second delay. For immediate execution, use desktop popups or webhook automation
- **Cooldown Necessity**: Without cooldown, rapidly touching price action can generate excessive alerts. Start with 3-bar cooldown and adjust based on alert volume
- **ATR Filter Impact**: Enabling ATR filter dramatically reduces alert count but improves quality. Track filter status in info table to understand when you're receiving fewer alerts
- **Commission Awareness**: High alert frequency means high potential trade count. Calculate if your commission structure supports frequent scalping before acting on all alerts
## COMPATIBLE MARKETS:
Works on any instrument with price data including stock indices (NQ, ES, YM, RTY), individual stocks, forex pairs (EUR/USD, GBP/USD), cryptocurrency (BTC, ETH), and commodities. Volume-based features are not included in this indicator version. Multi-timeframe ATR requires higher-tier TradingView subscription for request.security() functionality on timeframes below chart timeframe.
## KNOWN LIMITATIONS:
- **Indicator does not execute trades** - alerts are informational only; you must manually place all orders
- **Alert delivery depends on TradingView infrastructure** - delays or failures possible during platform issues
- **No position tracking** - indicator doesn't know if you're in a trade; you must manage open positions independently
- **TP/SL levels are reference only** - you must manually set these on your broker platform; they are not live orders
- **Immediate touch entry can generate many alerts** in choppy zones without adequate cooldown
- **Channel deletion at 10-tick breaks** may be too aggressive or lenient depending on instrument tick size
- **ATR filter from lower timeframes** requires TradingView Premium/Pro+ for request.security()
- **Mean reversion logic fails** in strong breakout scenarios - alerts will fire but trades may hit stops
- **No partial closing capability** - full position management is manual; you determine scaling out
- **Alerts do not account for gaps** or overnight price changes; morning alerts may be stale
## RISK DISCLOSURE:
Trading involves substantial risk of loss. This indicator provides signals for educational and informational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Mean reversion strategies can experience extended drawdowns during trending markets. Alerts are not guaranteed to be profitable and should be combined with your own analysis. Stop losses may not fill at intended levels during extreme volatility or gaps. Never trade with capital you cannot afford to lose. Consider consulting a licensed financial advisor before making trading decisions. Always verify alerts against current market conditions before executing trades manually.
## ACKNOWLEDGMENT & CREDITS:
This indicator is built upon the channel detection methodology created by **AlgoAlpha** in the "Smart Money Breakout Channels" indicator. Full credit and appreciation to AlgoAlpha for pioneering the normalized volatility approach to identifying consolidation patterns. The core channel formation logic using normalized price standard deviation is AlgoAlpha's original contribution to the TradingView community.
Enhancements to the original concept include: mean reversion entry logic (vs breakout), immediate touch-based alert generation, comprehensive alert condition system with customizable notifications, multi-timeframe ATR volatility filtering, cooldown period for alert management, dual TP methods (fixed points vs channel percentage), visual TP/SL reference lines, and real-time status monitoring table. This indicator version is specifically designed for manual traders who prefer alert-based decision making over automated execution.
BOCS Channel Scalper Strategy - Automated Mean Reversion System# BOCS Channel Scalper Strategy - Automated Mean Reversion System
## WHAT THIS STRATEGY DOES:
This is an automated mean reversion trading strategy that identifies consolidation channels through volatility analysis and executes scalp trades when price enters entry zones near channel boundaries. Unlike breakout strategies, this system assumes price will revert to the channel mean, taking profits as price bounces back from extremes. Position sizing is fully customizable with three methods: fixed contracts, percentage of equity, or fixed dollar amount. Stop losses are placed just outside channel boundaries with take profits calculated either as fixed points or as a percentage of channel range.
## KEY DIFFERENCE FROM ORIGINAL BOCS:
**This strategy is designed for traders seeking higher trade frequency.** The original BOCS indicator trades breakouts OUTSIDE channels, waiting for price to escape consolidation before entering. This scalper version trades mean reversion INSIDE channels, entering when price reaches channel extremes and betting on a bounce back to center. The result is significantly more trading opportunities:
- **Original BOCS**: 1-3 signals per channel (only on breakout)
- **Scalper Version**: 5-15+ signals per channel (every touch of entry zones)
- **Trade Style**: Mean reversion vs trend following
- **Hold Time**: Seconds to minutes vs minutes to hours
- **Best Markets**: Ranging/choppy conditions vs trending breakouts
This makes the scalper ideal for active day traders who want continuous opportunities within consolidation zones rather than waiting for breakout confirmation. However, increased trade frequency also means higher commission costs and requires tighter risk management.
## TECHNICAL METHODOLOGY:
### Price Normalization Process:
The strategy normalizes price data to create consistent volatility measurements across different instruments and price levels. It calculates the highest high and lowest low over a user-defined lookback period (default 100 bars). Current close price is normalized using: (close - lowest_low) / (highest_high - lowest_low), producing values between 0 and 1 for standardized volatility analysis.
### Volatility Detection:
A 14-period standard deviation is applied to the normalized price series to measure price deviation from the mean. Higher standard deviation values indicate volatility expansion; lower values indicate consolidation. The strategy uses ta.highestbars() and ta.lowestbars() to identify when volatility peaks and troughs occur over the detection period (default 14 bars).
### Channel Formation Logic:
When volatility crosses from a high level to a low level (ta.crossover(upper, lower)), a consolidation phase begins. The strategy tracks the highest and lowest prices during this period, which become the channel boundaries. Minimum duration of 10+ bars is required to filter out brief volatility spikes. Channels are rendered as box objects with defined upper and lower boundaries, with colored zones indicating entry areas.
### Entry Signal Generation:
The strategy uses immediate touch-based entry logic. Entry zones are defined as a percentage from channel edges (default 20%):
- **Long Entry Zone**: Bottom 20% of channel (bottomBound + channelRange × 0.2)
- **Short Entry Zone**: Top 20% of channel (topBound - channelRange × 0.2)
Long signals trigger when candle low touches or enters the long entry zone. Short signals trigger when candle high touches or enters the short entry zone. This captures mean reversion opportunities as price reaches channel extremes.
### Cooldown Filter:
An optional cooldown period (measured in bars) prevents signal spam by enforcing minimum spacing between consecutive signals. If cooldown is set to 3 bars, no new long signal will fire until 3 bars after the previous long signal. Long and short cooldowns are tracked independently, allowing both directions to signal within the same period.
### ATR Volatility Filter:
The strategy includes a multi-timeframe ATR filter to avoid trading during low-volatility conditions. Using request.security(), it fetches ATR values from a specified timeframe (e.g., 1-minute ATR while trading on 5-minute charts). The filter compares current ATR to a user-defined minimum threshold:
- If ATR ≥ threshold: Trading enabled
- If ATR < threshold: No signals fire
This prevents entries during dead zones where mean reversion is unreliable due to insufficient price movement.
### Take Profit Calculation:
Two TP methods are available:
**Fixed Points Mode**:
- Long TP = Entry + (TP_Ticks × syminfo.mintick)
- Short TP = Entry - (TP_Ticks × syminfo.mintick)
**Channel Percentage Mode**:
- Long TP = Entry + (ChannelRange × TP_Percent)
- Short TP = Entry - (ChannelRange × TP_Percent)
Default 50% targets the channel midline, a natural mean reversion target. Larger percentages aim for opposite channel edge.
### Stop Loss Placement:
Stop losses are placed just outside the channel boundary by a user-defined tick offset:
- Long SL = ChannelBottom - (SL_Offset_Ticks × syminfo.mintick)
- Short SL = ChannelTop + (SL_Offset_Ticks × syminfo.mintick)
This logic assumes channel breaks invalidate the mean reversion thesis. If price breaks through, the range is no longer valid and position exits.
### Trade Execution Logic:
When entry conditions are met (price in zone, cooldown satisfied, ATR filter passed, no existing position):
1. Calculate entry price at zone boundary
2. Calculate TP and SL based on selected method
3. Execute strategy.entry() with calculated position size
4. Place strategy.exit() with TP limit and SL stop orders
5. Update info table with active trade details
The strategy enforces one position at a time by checking strategy.position_size == 0 before entry.
### Channel Breakout Management:
Channels are removed when price closes more than 10 ticks outside boundaries. This tolerance prevents premature channel deletion from minor breaks or wicks, allowing the mean reversion setup to persist through small boundary violations.
### Position Sizing System:
Three methods calculate position size:
**Fixed Contracts**:
- Uses exact contract quantity specified in settings
- Best for futures traders (e.g., "trade 2 NQ contracts")
**Percentage of Equity**:
- position_size = (strategy.equity × equity_pct / 100) / close
- Dynamically scales with account growth
**Cash Amount**:
- position_size = cash_amount / close
- Maintains consistent dollar exposure regardless of price
## INPUT PARAMETERS:
### Position Sizing:
- **Position Size Type**: Choose Fixed Contracts, % of Equity, or Cash Amount
- **Number of Contracts**: Fixed quantity per trade (1-1000)
- **% of Equity**: Percentage of account to allocate (1-100%)
- **Cash Amount**: Dollar value per position ($100+)
### Channel Settings:
- **Nested Channels**: Allow multiple overlapping channels vs single channel
- **Normalization Length**: Lookback for high/low calculation (1-500, default 100)
- **Box Detection Length**: Period for volatility detection (1-100, default 14)
### Scalping Settings:
- **Enable Long Scalps**: Toggle long entries on/off
- **Enable Short Scalps**: Toggle short entries on/off
- **Entry Zone % from Edge**: Size of entry zone (5-50%, default 20%)
- **SL Offset (Ticks)**: Distance beyond channel for stop (1+, default 5)
- **Cooldown Period (Bars)**: Minimum spacing between signals (0 = no cooldown)
### ATR Filter:
- **Enable ATR Filter**: Toggle volatility filter on/off
- **ATR Timeframe**: Source timeframe for ATR (1, 5, 15, 60 min, etc.)
- **ATR Length**: Smoothing period (1-100, default 14)
- **Min ATR Value**: Threshold for trade enablement (0.1+, default 10.0)
### Take Profit Settings:
- **TP Method**: Choose Fixed Points or % of Channel
- **TP Fixed (Ticks)**: Static distance in ticks (1+, default 30)
- **TP % of Channel**: Dynamic target as channel percentage (10-100%, default 50%)
### Appearance:
- **Show Entry Zones**: Toggle zone labels on channels
- **Show Info Table**: Display real-time strategy status
- **Table Position**: Corner placement (Top Left/Right, Bottom Left/Right)
- **Color Settings**: Customize long/short/TP/SL colors
## VISUAL INDICATORS:
- **Channel boxes** with semi-transparent fill showing consolidation zones
- **Colored entry zones** labeled "LONG ZONE ▲" and "SHORT ZONE ▼"
- **Entry signal arrows** below/above bars marking long/short entries
- **Active TP/SL lines** with emoji labels (⊕ Entry, 🎯 TP, 🛑 SL)
- **Info table** showing position status, channel state, last signal, entry/TP/SL prices, and ATR status
## HOW TO USE:
### For 1-3 Minute Scalping (NQ/ES):
- ATR Timeframe: "1" (1-minute)
- ATR Min Value: 10.0 (for NQ), adjust per instrument
- Entry Zone %: 20-25%
- TP Method: Fixed Points, 20-40 ticks
- SL Offset: 5-10 ticks
- Cooldown: 2-3 bars
- Position Size: 1-2 contracts
### For 5-15 Minute Day Trading:
- ATR Timeframe: "5" or match chart
- ATR Min Value: Adjust to instrument (test 8-15 for NQ)
- Entry Zone %: 20-30%
- TP Method: % of Channel, 40-60%
- SL Offset: 5-10 ticks
- Cooldown: 3-5 bars
- Position Size: Fixed contracts or 5-10% equity
### For 30-60 Minute Swing Scalping:
- ATR Timeframe: "15" or "30"
- ATR Min Value: Lower threshold for broader market
- Entry Zone %: 25-35%
- TP Method: % of Channel, 50-70%
- SL Offset: 10-15 ticks
- Cooldown: 5+ bars or disable
- Position Size: % of equity recommended
## BACKTEST CONSIDERATIONS:
- Strategy performs best in ranging, mean-reverting markets
- Strong trending markets produce more stop losses as price breaks channels
- ATR filter significantly reduces trade count but improves quality during low volatility
- Cooldown period trades signal quantity for signal quality
- Commission and slippage materially impact sub-5-minute timeframe performance
- Shorter timeframes require tighter entry zones (15-20%) to catch quick reversions
- % of Channel TP adapts better to varying channel sizes than fixed points
- Fixed contract sizing recommended for consistent risk per trade in futures
**Backtesting Parameters Used**: This strategy was developed and tested using realistic commission and slippage values to provide accurate performance expectations. Recommended settings: Commission of $1.40 per side (typical for NQ futures through discount brokers), slippage of 2 ticks to account for execution delays on fast-moving scalp entries. These values reflect real-world trading costs that active scalpers will encounter. Backtest results without proper cost simulation will significantly overstate profitability.
## COMPATIBLE MARKETS:
Works on any instrument with price data including stock indices (NQ, ES, YM, RTY), individual stocks, forex pairs (EUR/USD, GBP/USD), cryptocurrency (BTC, ETH), and commodities. Volume-based features require data feed with volume information but are optional for core functionality.
## KNOWN LIMITATIONS:
- Immediate touch entry can fire multiple times in choppy zones without adequate cooldown
- Channel deletion at 10-tick breaks may be too aggressive or lenient depending on instrument tick size
- ATR filter from lower timeframes requires higher-tier TradingView subscription (request.security limitation)
- Mean reversion logic fails in strong breakout scenarios leading to stop loss hits
- Position sizing via % of equity or cash amount calculates based on close price, may differ from actual fill price
- No partial closing capability - full position exits at TP or SL only
- Strategy does not account for gap openings or overnight holds
## RISK DISCLOSURE:
Trading involves substantial risk of loss. Past performance does not guarantee future results. This strategy is for educational purposes and backtesting only. Mean reversion strategies can experience extended drawdowns during trending markets. Stop losses may not fill at intended levels during extreme volatility or gaps. Thoroughly test on historical data and paper trade before risking real capital. Use appropriate position sizing and never risk more than you can afford to lose. Consider consulting a licensed financial advisor before making trading decisions. Automated trading systems can malfunction - monitor all live positions actively.
## ACKNOWLEDGMENT & CREDITS:
This strategy is built upon the channel detection methodology created by **AlgoAlpha** in the "Smart Money Breakout Channels" indicator. Full credit and appreciation to AlgoAlpha for pioneering the normalized volatility approach to identifying consolidation patterns. The core channel formation logic using normalized price standard deviation is AlgoAlpha's original contribution to the TradingView community.
Enhancements to the original concept include: mean reversion entry logic (vs breakout), immediate touch-based signals, multi-timeframe ATR volatility filtering, flexible position sizing (fixed/percentage/cash), cooldown period filtering, dual TP methods (fixed points vs channel percentage), automated strategy execution with exit management, and real-time position monitoring table.