Capture explosive futures moves automatically. Use TradingView and webhooks to trade Bollinger Band squeeze breakouts on ES and NQ without watching the charts.

A TradingView Bollinger Band squeeze automation strategy detects periods of low volatility compression and automatically executes trades when price breaks out. The squeeze occurs when Bollinger Bands narrow inside Keltner Channels, signaling that a large directional move is building. By automating this setup through TradingView alerts and webhook integration, futures traders can capture breakouts without watching charts all day.
A Bollinger Band squeeze is a volatility contraction pattern where the bands narrow to their tightest point before a sharp price expansion. John Bollinger himself identified this as one of the most reliable setups in his methodology: when volatility compresses, it eventually releases with force. The question isn't whether the breakout will come. It's which direction it'll go.
Bollinger Band Squeeze: A condition where Bollinger Bands contract to a narrow width, indicating historically low volatility. For futures traders, this pattern often precedes breakout moves of 10+ ticks on ES or 40+ ticks on NQ.
The classic way to measure the squeeze is by comparing Bollinger Bands to Keltner Channels. When the Bollinger Bands move inside the Keltner Channels, the squeeze is "on." When they push back outside, the squeeze "fires." John Carter popularized this approach in his TTM Squeeze indicator, and it remains one of the most widely used volatility breakout setups in futures trading.
Here's the thing about squeezes: they're fractal. They show up on 1-minute charts and daily charts alike. But for automation purposes, the 5-minute and 15-minute timeframes on futures contracts tend to produce the cleanest signals because they balance noise filtering with timely entries. A squeeze on a 1-minute chart might last 8 bars. On a 15-minute chart, it could build over 2-3 hours before firing.
Bandwidth: A numerical measure of Bollinger Band width, calculated as (Upper Band - Lower Band) / Middle Band. Lower bandwidth values mean tighter compression. On ES futures, bandwidth below 0.003 on a 15-minute chart often signals an impending breakout.
Squeeze detection in Pine Script compares Bollinger Band width against Keltner Channel width on each bar, then triggers an alert condition when the bands contract below the channel boundaries. This is straightforward to code and runs natively inside TradingView, which means your indicator alerts fire without any external software.
The core logic involves three components:
When the upper Bollinger Band drops below the upper Keltner Channel AND the lower Bollinger Band rises above the lower Keltner Channel, the squeeze is active. Pine Script coding for this looks something like:
sqzOn = lowerBB > lowerKC and upperBB < upperKC
sqzOff = lowerBB < lowerKC or upperBB > upperKC
sqzFire = sqzOn[1] and sqzOff
The sqzFire condition is the money moment. That's when compression ends and expansion begins. You pair this with the momentum direction to determine whether the breakout is long or short. If momentum is positive and rising when the squeeze fires, you go long. Negative and falling, you go short.
Alert Conditions: Pine Script functions (alertcondition() or alert()) that tell TradingView to send a notification or webhook when specific criteria are met. These are the bridge between your chart analysis and automated trade execution.
For Pine Script automation, you'll use alertcondition() in a study (indicator) or the built-in strategy.entry() in a strategy script. The study approach is generally more flexible for webhook-based automation because you control the alert message format directly.
Building this strategy requires defining four things: the squeeze detection parameters, the entry trigger, the exit rules, and the alert message format that your automation platform will parse. Get any one of these wrong and the system either misses trades or takes bad ones.
Default Bollinger Band settings (20, 2.0) and Keltner Channel settings (20, 1.5) work on most futures contracts, but you may need to adjust based on the instrument's volatility profile. Here's what works for the major contracts based on 15-minute chart alerts:
ContractBB LengthBB StdDevKC LengthKC MultiplierMin Squeeze BarsES / MES202.0201.56NQ / MNQ202.0201.55GC202.0202.08CL201.5201.54
The "Min Squeeze Bars" column matters more than most traders realize. A squeeze that lasts only 2-3 bars hasn't built enough energy for a meaningful breakout. Requiring 4-8 bars of compression (depending on the contract) filters out the weak setups that go nowhere. This is something you track in the strategy tester to find the sweet spot for your preferred instrument.
The squeeze firing alone isn't your entry signal. You need momentum confirmation. The two most common approaches:
The price confirmation method is slower but produces fewer false signals. The momentum method gets you in earlier but will whipsaw more in choppy conditions. For automation, the momentum method works better because the entry logic is cleaner in Pine Script coding. No ambiguity, no discretion needed.
Automated exits need to be as mechanical as entries. Three exit approaches that work with squeeze strategies:
For a complete take-profit and stop-loss automation setup, you'll want to encode these rules directly into your alert message so the automation platform handles execution without manual intervention.
Your TradingView alert needs to send a properly formatted webhook payload that your automation platform can parse. A typical JSON format for a squeeze long entry on ES:
{
"action": "buy",
"symbol": "ES",
"qty": 1,
"stop": {{close}} - 6,
"target": {{close}} + 9,
"strategy": "bb_squeeze"
}
The exact format depends on which automation platform you use. ClearEdge Trading accepts JSON webhooks with specific field mappings for order type, quantity, stop, and target. Other platforms have their own formats. Match your alert message format to your platform's documentation.
TradingView webhook setup is the bridge between your squeeze detection script and actual order execution at your broker. When the alert fires, TradingView sends an HTTP POST request to your automation platform's URL, which then places the order through your broker's API.
The process flow is:
Webhook Payload: The data package sent from TradingView to your automation platform when an alert fires. It contains trade instructions (buy/sell, quantity, stops, targets) in JSON format. Malformed payloads are the #1 cause of automation failures.
A few practical points about TradingView alerts automation that trip people up. First, TradingView has alert limits based on your plan. Free accounts get 1 active alert. Pro gets 20. Premium gets 400. If you're running squeeze detection across multiple timeframes and instruments, you'll need Premium or higher.
Second, alerts can expire. TradingView alerts have a maximum active duration, and if you don't manage them, they'll silently stop working. Our guide on preventing alert expiration covers the workarounds.
Third, TradingView bot trading through webhooks requires your automation platform to be running 24/7. A VPS or cloud-based platform handles this. Desktop-only solutions will miss alerts when your computer sleeps or loses connection.
ES and NQ futures produce the most consistent squeeze breakout signals due to their high liquidity and relatively clean price action during Regular Trading Hours. CL (crude oil) generates plenty of squeezes too, but the breakouts tend to be more violent and harder to manage with fixed stops.
Here's how the major contracts compare for squeeze automation:
ContractAvg Squeeze Duration (15m)Avg Breakout MoveFalse Signal RateBest SessionES8-12 bars6-10 points ($75-125/contract)~35%9:30-11:30 AM ETNQ6-10 bars25-50 points ($125-250/contract)~30%9:30-11:00 AM ETGC10-15 bars$5-12 ($500-1,200/contract)~40%8:30-11:00 AM ETCL5-8 bars$0.30-0.80 ($300-800/contract)~38%9:00-10:30 AM ET
These numbers come from backtesting 15-minute chart data. Your results will vary based on parameter choices and market conditions. The false signal rate is why momentum confirmation and minimum squeeze duration filters matter so much. Without them, you're looking at 50%+ false breakouts.
For multi-timeframe alerts, some traders run the squeeze detection on a higher timeframe (60-minute) for direction bias, then enter on the 15-minute squeeze fire in the same direction. This approach reduces trade frequency but improves win rate. The multi-timeframe alerts guide explains how to set this up in TradingView.
If you're running this on micro contracts (MES, MNQ), the logic is identical but your position sizing changes. A micro futures automation setup lets you test the strategy with 1/10th the risk of full-size contracts.
After reviewing hundreds of TradingView futures trading setups, these are the mistakes that kill squeeze strategies most often:
You need at least TradingView Pro ($14.95/month) for webhook alerts, which are required for automation platform integration. If you plan to run squeeze alerts on multiple instruments or timeframes simultaneously, Premium or higher gives you more active alerts.
Yes. TradingView has built-in Bollinger Band indicators you can set alerts on, and several free community scripts implement squeeze detection. No-code platforms like ClearEdge Trading handle the execution side without programming. You do need to understand the alert conditions you're setting, though.
On a 15-minute chart for a single instrument like ES, expect 1-3 squeeze signals per day during active RTH sessions. Some days produce zero signals if volatility stays consistently high or low without the compression-expansion cycle.
The squeeze pattern works identically on micro contracts (MES, MNQ) because the price chart is the same as the full-size contract. The only difference is position sizing and dollar risk per trade. Micros are a good way to validate the automation setup before scaling up.
False breakouts are the primary risk. Price breaks out of the squeeze, triggers your entry, then reverses back into the range. This is why momentum confirmation, minimum squeeze duration, and proper stop placement are all required, not optional. Past performance does not guarantee future results.
Indicator alerts (from studies) give you more control over the webhook payload and alert message format. Strategy alerts include built-in backtesting but have limitations on message customization. For most TradingView webhook setup workflows, indicator alerts are the better choice.
A TradingView Bollinger Band squeeze automation strategy gives you a systematic way to capture volatility breakouts on futures contracts without staring at screens all day. The core setup involves Pine Script squeeze detection, momentum confirmation, properly formatted webhook alerts, and an automation platform that routes orders to your broker in milliseconds.
Start by paper trading the strategy on a single instrument like ES or MES during RTH. Track your results for at least 30 trades before committing real capital. For the complete framework on connecting TradingView to your broker, read our TradingView automation guide.
Want to dig deeper? Read our complete guide to TradingView automation for more detailed webhook setup instructions and strategy examples.
Disclaimer: This article is for educational purposes only. It is not trading advice. ClearEdge Trading executes trades based on your rules; it does not provide signals or recommendations.
Risk Warning: Futures trading involves substantial risk. You could lose more than your initial investment. Past performance does not guarantee future results. Only trade with capital you can afford to lose.
CFTC RULE 4.41: Hypothetical results have limitations and do not represent actual trading.
By: ClearEdge Trading Team | About
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Block quote
Ordered list
Unordered list
Bold text
Emphasis
Superscript
Subscript
Every week, we break down real strategies from traders with 100+ years of combined experience, so you can skip the line and trade without emotion.
