Volatility Coil Edge [BullByte]Volatility Coil Edge is a reversal detection script designed for intraday traders operating in futures, indices, and crypto markets. It identifies a specific and repeatable market condition: price compressing into a tight range at the extreme boundary of a session, then breaking out of that compression in the opposing direction. The compression is the footprint. The break is the trigger. Everything else - entry, stop, and three scaled targets - is calculated automatically from the structure itself.
This script is built from custom logic rather than a simple wrapper of standard indicators. VCE is built from a custom volatility state machine designed specifically for detecting absorption-and-release patterns at session extremes. There is no RSI. No MACD. No Bollinger Band. The logic is derived entirely from price geometry, ATR ratio mathematics, and session range physics.
---
WHAT IS A VOLATILITY COIL
Price does not move in straight lines. It expands and contracts in cycles . When price reaches the edge of its established session range and begins contracting - forming smaller and smaller bars with decreasing volatility relative to recent history - it is coiling. This coil represents a temporary equilibrium between buyers and sellers at a structurally significant location.
The coil at a session high means sellers have been absorbing every attempt to push higher. The coil at a session low means buyers have been absorbing every attempt to push lower. When that absorption ends and price breaks through the coil boundary in the reversal direction, it signals that one side may be losing control and the opposite side may begin to take over.
VCE detects this moment and marks it on the close of the break bar. The script combines session-extreme context, multi-condition compression logic, violation tolerance, and post-impulse detection within one unified engine.
---
WHY THIS WORKS AND WHY IT IS ORIGINAL
Most volatility indicators measure contraction globally across the entire chart. VCE measures contraction locally and contextually - it only cares about compression that forms at the edges of the current session range. A tight range forming in the middle of a session is noise. The same tight range forming at the session high or low is a structural event.
The detection engine uses three simultaneous compression conditions:
The first is a ratio comparison between a short-period local ATR and a longer-period background ATR . When the local ATR falls below a calibrated percentage of the background ATR, the bar qualifies as contracted.
The second is a drift-floor condition that catches low-volatility regimes where the ratio test alone would miss genuine compressions. It compares the current bar range against the rolling median bar range.
The third is Catalyst Mode, which identifies compressions forming immediately after a volatility expansion - the post-impulse coil. These are often a strong setup type because they represent price stalling after a strong directional move, often marking exhaustion at the extreme.
All three conditions feed a state machine that tracks how many consecutive bars meet the compression criteria, applies violation tolerance so that minor range extensions do not invalidate real coils, and enforces a maximum coil length to prevent stale consolidations from triggering signals.
---
THREE SENSITIVITY TIERS
Conservative: Requires the tightest compression and the longest minimum coil duration. Generates fewer signals. Best for traders who prefer higher-filter setups and can wait.
Balanced: The recommended default. Moderate compression requirements and signal frequency. Suitable for most intraday traders across all supported markets.
Aggressive: Captures looser compressions and shorter coils. Higher signal frequency. Best for very active scalpers who want early entries and manage risk with tight stops.
All three tiers can be fully overridden with manual parameter control for experienced users who want to calibrate to a specific instrument.
---
CATALYST MODE
When enabled, Catalyst Mode adds a fourth detection layer. If any of the last five bars showed a range greater than 1.5 times the background ATR, the engine recognizes that a volatility expansion just occurred. Compressions forming immediately after an expansion are flagged even if the ratio test alone would not qualify them. These post-impulse coils frequently mark the confirmed point where momentum stalls and reversal begins.
---
SIGNAL MECHANICS
This tool provides a systematic framework for identifying the pattern and managing the trade once it fires. A historical bar is exactly what you would have seen in real time on that bar's close.
LONG signals fire when a qualified compression forms at the session low zone and price closes above the upper boundary of the coil on the break bar.
SHORT signals fire when a qualified compression forms at the session high zone and price closes below the lower boundary of the coil on the break bar.
---
ENTRY, STOP, AND TARGETS
Entry is the close price of the signal bar.
The stop loss is placed beyond the structural extreme of the coil - below the coil low for longs, above the coil high for shorts - with an ATR buffer added for breathing room. A minimum stop distance floor prevents dangerously tight stops on very small coils.
The stop distance itself is bounded between an ATR floor and an ATR ceiling so that all three targets remain proportionally realistic regardless of coil size. Targets are then calculated as pure R-multiples of the final bounded stop distance:
TP1 defaults to 1.0R - the point where the trade has covered its own risk.
TP2 defaults to 1.5R - the primary partial profit zone.
TP3 defaults to 2.0R - the full target. Hitting TP3 closes the trade and removes all drawings.
TP1 and TP2 are milestone targets. When hit, a yellow dot marks the price level and the trade remains open. The stop loss and all three target lines remain live until TP3 or the stop is reached.
All R-multiple values are user-adjustable. The stop buffer and minimum distance are also adjustable.
---
VISUAL ELEMENTS
Signal Card: A labeled marker appears at every signal bar showing direction (LONG or SHORT), the number of bars in the coil, and the TP2 R-multiple. In Minimalist mode, only the direction is shown. Signal cards are permanent - every historical signal remains visible for review.
Level Lines: At signal time, five horizontal lines are drawn - entry, stop loss, TP1, TP2, TP3 - each with a floating price label to the right. Lines extend forward bar by bar during the trade and terminate cleanly at the outcome bar.
Coil Box: While a compression is being watched, a dashed orange box outlines the coil range. The box updates in real time as the coil extends. A small tag shows direction bias and bar count.
Concentric Rings: Four nested rings are drawn around the signal bar at entry, scaling with ATR. They persist for the duration of the trade as a visual anchor and are removed automatically at outcome.
Milestone Dots: Yellow dots mark the exact bar and price where TP1 and TP2 are touched during the trade.
Signal Bar Highlight: The background of the signal bar is tinted green for longs and red for shorts.
---
THE DASHBOARD
The dashboard panel shows the current state of the engine at a glance. It updates on every bar close.
The header shows the ticker symbol and timeframe so the panel is always self-identifying across multiple open charts.
STATE shows one of four conditions: IDLE when no coil is active, FORMING with a bar count when compression is building but not yet qualified, WATCH LONG or WATCH SHORT when a qualified coil is positioned at an extreme and the engine is waiting for a break, and ACTIVE LONG or ACTIVE SHORT during a live trade.
COIL shows the current compression bar count and the local-to-background ATR ratio as a percentage. Lower percentage means tighter compression.
ZONE shows where the active coil is positioned - session high, session low, or mid-range for forming coils that have not yet reached an extreme.
ENTRY shows the direction and confirmed entry price of the active trade.
TARGETS shows three dots - one for each TP level. Dots fill yellow as each milestone is hit during the trade.
---
RECOMMENDED MARKETS AND TIMEFRAMES
VCE is designed for liquid intraday markets with defined session structure. It performs better on instruments that have clear daily range boundaries and regular volatility patterns.
Recommended markets: NQ, ES, MNQ, MES futures. BTC, ETH, SOL perpetual futures. Major crypto spot pairs. SPY, QQQ intraday.
Recommended timeframes: The script performs strongest on the 15 minute timeframe where session structure is cleanest and compression patterns carry the most weight. The 5 minute and 3 minute timeframes are well suited for standard intraday work. The 1 minute timeframe is for aggressive scalping and requires tighter risk management due to higher noise levels.
The Session Range Lookback input should be calibrated to approximately one full session worth of bars on your chosen timeframe. On a 5-minute chart, one RTH session is roughly 78 bars. On a 1-minute chart, approximately 390 bars. The default of 50 is a balanced starting point for 3-minute and 5-minute charts.
On a 15-minute chart one full RTH session is approximately 26 bars; set Session Range Lookback to 26 to 30 for clean session-extreme detection on this timeframe.
---
HOW TO READ A LIVE SETUP (USAGE)
Step one : Watch for the dashboard STATE to change from IDLE to FORMING. This means compression is building somewhere on the chart.
Step two: When STATE changes to WATCH LONG or WATCH SHORT, the coil has qualified and is positioned at a session extreme. The orange coil box becomes visible. The engine is now armed.
Step three: Do not act on WATCH alone. Wait for the signal card to appear. The signal only fires on bar close when the coil has been broken in the reversal direction. The signal card, level lines, and rings all appear simultaneously at that moment.
Step four: Entry is the close of the signal bar. Place your stop at the SL line. Your targets are TP1, TP2, and TP3 as shown on the chart.
Step five: TP1 and TP2 mark themselves with yellow dots as they are hit. The trade closes automatically in the visual display when TP3 or SL is reached, and all lines are removed cleanly.
CHART EXAMPLE
The Science of Price Coiling : Silver 5m
Price surged aggressively into the session high zone, driven by strong buying momentum. But at the extreme, buyers ran out of fuel. Over the next 4 bars, the range shrank bar by bar, candles got smaller, volatility dried up, and neither buyers nor sellers could dominate.
This is the coil: not random sideways movement, but compressed energy at an unstable equilibrium. The longer price holds at an extreme without continuing, the more it signals that the side that drove it there is exhausting. When sellers finally overwhelmed the weakened buyers, price broke below the coil floor in a single decisive bar, releasing all stored tension in one direction.
That break was not a prediction. It was a consequence. The compression was the warning, the location was the context, and the break was simply the market resolving the imbalance it had been building. This is what VCE detects, not the move itself, but the conditions that make the move inevitable.
---
ALERT SETUP
Two alert conditions are built in:
VCE Long Signal fires on bar close when a LONG setup triggers.
VCE Short Signal fires on bar close when a SHORT setup triggers.
To activate : open the Alerts panel, select Create Alert, choose VCE as the condition source, and select either Long Signal or Short Signal. Set the trigger to Once Per Bar Close. No additional configuration is needed.
---
INPUTS REFERENCE
Sensitivity: Conservative, Balanced, or Aggressive preset. Controls compression tightness, minimum coil length, zone threshold, and break definition simultaneously.
Catalyst Mode: Enables post-impulse coil detection. Recommended ON for all markets.
Use Manual Overrides: Replaces the sensitivity preset with the four manual parameters below it.
Min Bars: Minimum consecutive compression bars required before a coil qualifies.
Max Bars: Maximum coil length before the coil is invalidated and reset.
Contraction Ratio: Local ATR must be below this fraction of the background ATR to register as a compressed bar.
Extreme Zone Percent: Defines what fraction of the session range constitutes the high and low extreme zones.
Background ATR Period: Smoothing period for the volatility baseline used in compression detection.
Session Range Lookback: Number of bars defining the rolling session high and low.
ATR Period: Period for the ATR used in stop and target calculations.
Post-Outcome Bar Gap: Minimum bars of silence after a trade closes before the next signal can fire.
SL Buffer: ATR multiplier added beyond the coil extreme when calculating the structural stop.
Min SL Distance: Floor for the stop distance as an ATR multiple. Prevents unrealistically tight stops.
Max SL Distance: Ceiling for the stop distance as an ATR multiple. Prevents absurdly wide stops on tall coils and keeps all TP levels proportionally realistic for the chosen timeframe.
TP1, TP2, TP3: Take-profit levels as multiples of the stop distance.
Label Right Offset: Controls how far to the right floating price labels appear.
Minimalist Signal Card: Shows only LONG or SHORT on the signal card when enabled.
Show Coil Box: Toggles the live orange compression box.
Highlight Signal Bar: Toggles background tinting on signal bars.
Show Concentric Ring Signature: Toggles the nested ring visual at signal bars.
Show Dashboard: Toggles the status panel.
Theme: Dark or Light. Adjusts all label, line, and panel colors for chart background compatibility.
Position: Sets the dashboard anchor position on the chart.
---
NOTES ON PERFORMANCE AND EXPECTATIONS
VCE identifies a specific structural pattern. Not every coil produces a sustained reversal. Session context, macro flow, and news events all influence whether a given setup follows through. The tool provides a systematic framework for identifying the pattern and managing the trade once it fires. Risk management decisions remain with the trader.
The post-outcome bar gap input exists to prevent the engine from immediately re-entering after a stopped trade. This is a deliberate design choice, not a limitation.
---
DISCLAIMER
This script is published for educational and informational purposes only. It is not financial advice and does not constitute a recommendation to buy or sell any financial instrument. Past signal behavior does not guarantee future results. Trading involves significant risk of loss. Always conduct your own research and apply your own risk management framework before making any trading decision.
Pine Script®指標






















