All signals
0 installsFeatured
ExoScope Signal

ExoScope Momentum Breakout

Breakouts through Bollinger bands and recent range highs/lows with volume spike and expanding MACD histogram.

exoscopebreakoutvolumemacd
Sign in to installPublished 5/20/2026

Source

42 lines · 1838 chars

const lookback = input('lookback', 20, { min: 10, max: 60 });
const minGap = input('min_gap', 10, { min: 5, max: 30 });
const volMult = input('vol_multiplier', 1.8, { min: 1.2, max: 3, type: 'float' });

const bb = ta.bb(close, 20, 2);
const macd = ta.macd(close);
const ema20 = ta.ema(close, 20);
const volAvg = ta.sma(volume, lookback);

let last = -minGap;
for (let i = lookback; i < barCount; i++) {
  if (i - last < minGap) continue;
  if (bb.upper[i] === null || bb.lower[i] === null || macd.histogram[i] === null || macd.histogram[i - 1] === null || ema20[i] === null || volAvg[i] === null) continue;
  let recentHigh = -Infinity;
  let recentLow = Infinity;
  for (let j = i - lookback; j < i; j++) {
    if (high[j] > recentHigh) recentHigh = high[j];
    if (low[j] < recentLow) recentLow = low[j];
  }
  const volSpike = volume[i] > volAvg[i] * volMult;
  let buyScore = 0;
  let sellScore = 0;
  if (close[i] > bb.upper[i]) buyScore += 2;
  if (close[i] > recentHigh) buyScore += 2;
  if (close[i] > ema20[i] && close[i - 1] <= ema20[i - 1]) buyScore += 1;
  if (macd.histogram[i] > 0 && macd.histogram[i] > macd.histogram[i - 1]) buyScore += 1;
  if (volSpike && buyScore > 0) buyScore += 1;
  if (close[i] < bb.lower[i]) sellScore += 2;
  if (close[i] < recentLow) sellScore += 2;
  if (close[i] < ema20[i] && close[i - 1] >= ema20[i - 1]) sellScore += 1;
  if (macd.histogram[i] < 0 && macd.histogram[i] < macd.histogram[i - 1]) sellScore += 1;
  if (volSpike && sellScore > 0) sellScore += 1;
  if (buyScore >= 4 && buyScore > sellScore) {
    signal(i, 'buy', close[i], buyScore >= 6 ? 'Breakout' : 'Break up');
    last = i;
  } else if (sellScore >= 4 && sellScore > buyScore) {
    signal(i, 'sell', close[i], sellScore >= 6 ? 'Breakdown' : 'Break down');
    last = i;
  }
}

Code runs in a sandboxed Web Worker — no network or DOM access. Use at your own risk. Not financial advice.