Indicator · Pine Script v5 · On the chart

Iron Condor Signal (Range Detector)

by SankarSrinivasan1

The Iron Condor Signal (Range Detector) is an overlay indicator that identifies range-bound, low-trend market conditions suitable for non-directional trading strategies.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code40
Settings7inputs
LicenceGPL-3.0
Last update4 months ago21 Jun 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

40 lines of Pine Script v5 from iron-condor.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

iron-condor.pine
//@version=5
indicator("Iron Condor Signal (Range Detector)", overlay=true)
// Inputs
lengthBB = input.int(20, "BB Length")
mult = input.float(2.0, "BB Multiplier")
adxLen = input.int(14, "ADX Length")
adxThreshold = input.float(20.0, "ADX Threshold (Low Trend)")
rsiLen = input.int(14, "RSI Length")
rsiLow = input.int(40, "RSI Lower")
rsiHigh = input.int(60, "RSI Upper")
// Bollinger Bands
basis = ta.sma(close, lengthBB)
dev = mult * ta.stdev(close, lengthBB)
upper = basis + dev
lower = basis - dev
// ADX (trend strength)
upMove = high - high[1]
downMove = low[1] - low
plusDM = (upMove > downMove and upMove > 0) ? upMove : 0
minusDM = (downMove > upMove and downMove > 0) ? downMove : 0
trur = ta.rma(ta.tr(true), adxLen)
plusDI = 100 * ta.rma(plusDM, adxLen) / trur
minusDI = 100 * ta.rma(minusDM, adxLen) / trur
dx = 100 * math.abs(plusDI - minusDI) / (plusDI + minusDI)
adx = ta.rma(dx, adxLen)
// RSI (momentum neutrality)
rsi = ta.rsi(close, rsiLen)
// Conditions
lowTrend = adx < adxThreshold
insideBands = close < upper and close > lower
neutralMomentum = rsi > rsiLow and rsi < rsiHigh
condorSignal = lowTrend and insideBands and neutralMomentum
// Plot
plot(upper, color=color.red)
plot(lower, color=color.green)
plot(basis, color=color.blue)
bgcolor(condorSignal ? color.new(color.yellow, 80) : na)
plotshape(condorSignal, title="Condor Signal", location=location.abovebar, color=color.orange, style=shape.labeldown, text="IC")
// Alerts
alertcondition(condorSignal, title="Iron Condor Signal", message="Range market detected. Consider Iron Condor.")

Overview

Iron Condor Signal (Range Detector) calculates Bollinger Bands, the Average Directional Index (ADX), and the Relative Strength Index (RSI). A range signal triggers when price remains inside the Bollinger Bands, ADX indicates a low trend, and RSI demonstrates neutral momentum. The script plots Bollinger Bands on the main price chart, highlights range bars with background coloring, and displays signal labels. Users can adjust the band multipliers, ADX threshold, and RSI limits.

Details

Published by

SankarSrinivasan1 on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Volatility & bands, Trend, Oscillators & momentum

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
BB Lengthint20lengthBB
BB Multiplierfloat2.0mult
ADX Lengthint14adxLen
ADX Threshold (Low Trend)float20.0adxThreshold
RSI Lengthint14rsiLen
RSI Lowerint40rsiLow
RSI Upperint60rsiHigh
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

The Momentum Setup is a multi-indicator visual tool designed for trend and momentum analysis directly on the price chart. It combines Relative Strength Index (RSI), Money Flow Index (MFI), Commodity Channel Index (CCI), Supertrend, and a 250-bar percentage cha

Indicator v5 Oscillators & momentumTrend
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - Ankush Bajaj Momentum Investing Setup
257 stars

An overlay indicator that combines an ATR-based SuperTrend trailing stop with an integrated RSI-derived midline calculation on the price chart. The SuperTrend uses an ATR period and factor multiplier to plot dynamic green or red trend lines based on price dire

Indicator v5 TrendVolatility & bands
Updated 6 weeks ago · None stated GitHub repository of SuperTrend ATR + RSI
114 stars

ADX Strategy (original) is an overlay indicator that identifies trend-following trade signals using the Average Directional Index (ADX) combined with a Simple Moving Average filter. A long signal is generated when the ADX rises above a user-defined trend level

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Strategy (original)

Moon Dev Lunar Sniper

by moondevonyt
92 stars

Moon Dev Lunar Sniper is a multi-indicator overlay that scores confluence across fast and slow EMAs, RSI, MACD, DMI, and BB width to fire signals only when score meets the minimum threshold. It plots buy and sell signals on the price chart, highlights cosmic b

Indicator v6 TrendOscillators & momentum Repaints
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev Lunar Sniper
56 stars

Double Screened Decision is a multi-timeframe trend and momentum indicator overlaid directly on the price chart. It dynamically selects a higher timeframe based on the active chart resolution to evaluate higher-timeframe MACD, Bollinger Bands, RSI, and Stochas

Indicator v5 TrendMoving averages Repaints
Updated 4 months ago · None stated GitHub repository of Double Screened Decision
55 stars

The VibeTrader Signal System is an overlay indicator that identifies trend direction and potential reversal conditions. It calculates a Supertrend line alongside Bollinger Bands and a 14-period RSI indicator. The script highlights bullish and bearish trends by

Indicator v6 TrendVolatility & bands
Updated 6 months ago · Apache-2.0 GitHub repository of VibeTrader Signal System

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers