ExoScope Signal
ExoScope Mean Reversion
Scores oversold/overbought setups using Bollinger band position, RSI extremes, and Stochastic confirmation. Fires when the composite score crosses the threshold.
exoscopebollingerrsimean-reversion
Sign in to installPublished 5/20/2026
Source
41 lines · 1298 chars
const minGap = input('min_gap', 8, { min: 3, max: 30 });
const rsiPeriod = input('rsi_period', 14);
const bbPeriod = input('bb_period', 20, { min: 10, max: 50 });
const rsi = ta.rsi(close, rsiPeriod);
const bb = ta.bb(close, bbPeriod, 2);
const st = ta.stoch(high, low, close, 14, 3, 3);
let last = -minGap;
for (let i = bbPeriod; i < barCount; i++) {
if (i - last < minGap) continue;
if (bb.upper[i] === null || bb.lower[i] === null || rsi[i] === null) continue;
const width = bb.upper[i] - bb.lower[i];
if (width <= 0) continue;
const pos = (close[i] - bb.lower[i]) / width;
const k = st.k[i];
const d = st.d[i];
let buyScore = 0;
let sellScore = 0;
if (pos < 0.15) buyScore += 2;
else if (pos < 0.25) buyScore += 1;
if (pos > 0.85) sellScore += 2;
else if (pos > 0.75) sellScore += 1;
if (rsi[i] < 30) buyScore += 2;
else if (rsi[i] < 40) buyScore += 1;
if (rsi[i] > 70) sellScore += 2;
else if (rsi[i] > 60) sellScore += 1;
if (k !== null && d !== null) {
if (k < 25 && k > d) buyScore += 1;
if (k > 75 && k < d) sellScore += 1;
}
if (buyScore >= 3) {
signal(i, 'buy', close[i], 'MR buy');
last = i;
} else if (sellScore >= 3) {
signal(i, 'sell', close[i], 'MR sell');
last = i;
}
}
Code runs in a sandboxed Web Worker — no network or DOM access. Use at your own risk. Not financial advice.