AI Strategy Playbook

Bollinger Band Squeeze & Breakout AI Agent (MCP Script)

Volatility is mean-reverting: extreme compression precedes explosive moves. Measuring Bollinger Band width across 20 liquid pairs in a single sandbox call uncovers squeezes before retail traders notice.

Updated: By Eterna Quant & AI Team (Systematic Execution & MCP Playbooks)Read as Markdown
Strategy Summary

Call `eterna.getBollingerBands()` alongside `eterna.getTickers()` inside one `execute_code` script to rank coins with the tightest band width `(upper - lower) / middle`. When price closes outside a compressed band with expanding 24h turnover, your agent enters in the breakout direction with a stop at the middle band.

Core SDK MethodgetBollingerBands()Upper, middle, lower bands
Compression MetricBandwidth %(upper - lower) / middle
InvalidationMiddle Band (20 SMA)Clean structural stopLoss
Execution Speed<200msLow slippage on breakout fills
https://mcp.eterna.exchange/mcp

1. Runnable Bollinger Squeeze Scanner

bollinger-squeeze-scan.ts
const watchlist = ["BTCUSDT", "ETHUSDT", "SOLUSDT", "AVAXUSDT", "DOGEUSDT", "ARBUSDT", "OPUSDT"];
const results = [];

for (const symbol of watchlist) {
  const [ticker, bb] = await Promise.all([
    eterna.getTickers({ symbol }),
    eterna.getBollingerBands({ symbol, interval: "60", period: 20, stdDev: 2 }),
  ]);

  const price = Number(ticker[0].lastPrice);
  const upper = Number(bb.upper);
  const middle = Number(bb.middle);
  const lower = Number(bb.lower);
  const bandwidthPct = ((upper - lower) / middle) * 100;

  results.push({
    symbol,
    price,
    bandwidthPct: Number(bandwidthPct.toFixed(2)),
    breakout: price > upper ? "UPPER_BREAK" : price < lower ? "LOWER_BREAK" : "INSIDE",
  });
}

return results.sort((a, b) => a.bandwidthPct - b.bandwidthPct);
Returns: Watchlist sorted from tightest volatility compression to widest, flagging live band breaks.
FAQ

Frequently asked questions

How do I filter out false Bollinger breakouts?
Require a candle close outside the band on 1h or 4h timeframes, confirm healthy orderbook depth with `eterna.getOrderbook()`, and avoid entering right before major scheduled macro announcements.
Primary Sources

References & verification links

Start Trading via MCP

Connect your AI agent in 30 seconds

One remote MCP URL. 800+ USDT perpetuals, 380+ spot pairs, 0.014% maker / 0.035% taker, no KYC.

View on GitHub