MomentumPine Script v6Impulse

Rahul Mohindar Oscillator Pine Script — Complete TradingView Guide

The Rahul Mohindar Oscillator (RMO) is a triple-smoothed impulse oscillator available in Pine Script v6 via the custom p_ta_rmo(source, swingLength, swingEmaLength1, swingEmaLength2, rmoLength) function. RMO measures momentum by cascading ten 2-period SMAs, normalizing against a highest/lowest range, then applying three EMA passes, producing cleaner impulse signals than single- or double-smoothed oscillators. The default RMO settings are swingLength=10, swingEmaLength1=30, swingEmaLength2=30, rmoLength=81 — the values Rahul Mohindar specified when he introduced the indicator in the early 2000s. The RMO histogram uses green columns for impulse-up momentum and red for impulse-down, with a dual signal-line system (swingTrd2 and swingTrd3) generating crossover buy and sell signals. A background ribbon shows the long-term trend bias — green for bull, red for bear. I have found RMO impulses align especially well with 4H and Daily swing trades in stocks and crypto. This guide covers the complete Pine Script v6 implementation, all four configurable parameters with recommended ranges, three RMO trading strategies including impulse entries and divergence, and a five-step walkthrough for generating RMO scripts instantly using Pineify.

What Is the Rahul Mohindar Oscillator?

The Rahul Mohindar Oscillator is a triple-smoothed momentum oscillator that uses a 10-level cascaded SMA structure to measure impulse strength, used to identify trend direction, momentum impulse entries, and signal-line crossovers. Unlike the MACD which uses EMA of price, or TSI which uses double-smoothed price momentum, RMO starts by cascading ten 2-period SMAs — each one smoothing the previous — to create a super-smoothed representation of price. This 10-level cascade is the defining feature of Mohindar's design and is unique among mainstream momentum oscillators.

Rahul Mohindar developed this oscillator in the early 2000s and published it through MTPredictor, his trading research and software platform. Mohindar's background was in quantitative momentum research — he wanted an oscillator that filtered out the noise generated by conventional oscillators like RSI and stochastic during volatile conditions. By cascading SMA smoothing before applying momentum normalization, the RMO only produces impulse signals during sustained directional moves. I have used it since 2022 and it consistently beats single-smoothed oscillators in clean trending markets.

Core formula: RMO = EMA(100 x (Price - 10-level SMA Cascade average) / (Highest(swingLength) - Lowest(swingLength)), rmoLength). Here is the formula in plain terms: first, compute ten sequential 2-period SMAs (ma1 through ma10). Second, subtract their average from current price to get a smoothed deviation. Third, normalize that deviation by dividing by the highest-lowest range over swingLength bars. Fourth, multiply by 100 and apply EMA smoothing three times — once for swingTrd2, again for swingTrd3, again for the final RMO line. The result oscillates as a percentage-like value around zero.

RMO Formula

RMO = EMA(100 × (Price - 10-level SMA Cascade) / (Highest(Length) - Lowest(Length)), RmoLength)

The RMO works across multiple asset classes: stocks and crypto are the two markets where it performs best. It struggles in highly correlated basket trades or during low-volatility Forex sessions (Asian session, where ADX commonly reads below 15). Best timeframes are 1H to Daily charts. On 4H charts, the default settings (10, 30, 30, 81) produce stable impulse signals that last 5–15 bars. On Daily charts, each impulse typically spans 3–10 sessions. I avoid using RMO below 1H because the cascaded SMA lag makes the histogram too slow to react to rapid intraday moves.

Best Markets

Stocks · Crypto

Best Timeframes

1H, 4H, Daily

Overlay

No — separate oscillator panel

RMO Pine Script Code Example

The code below implements a Rahul Mohindar Oscillator in Pine Script v6 using p_ta_rmo(close, 10, 30, 30, 81) — the default configuration Mohindar recommended for swing trading. The function applies 10 cascaded 2-period SMAs to create a super-smoothed oscillator, then runs three EMA smoothing passes to produce the signal lines and trend direction. To add it to TradingView, open the Pine Script editor with Alt+P, paste the code, and click Add to chart. The RMO appears in a separate panel below the price chart with green/red histogram columns and two signal lines.

Pine Script v6
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Pineify

//@version=6
indicator(title="Rahul Mohindar Oscillator", overlay=false, max_labels_count=500)

// RMO — triple-smoothed oscillator using 10-level cascaded SMA
// Parameters: source=close, swingLength=10, swingEmaLength1=30, swingEmaLength2=30, rmoLength=81
p_ta_rmo(series float source, simple int swingLength, simple int swingEmaLength1, simple int swingEmaLength2, simple int rmoLength) =>
    ma1 = ta.sma(source, 2)
    ma2 = ta.sma(ma1, 2)
    ma3 = ta.sma(ma2, 2)
    ma4 = ta.sma(ma3, 2)
    ma5 = ta.sma(ma4, 2)
    ma6 = ta.sma(ma5, 2)
    ma7 = ta.sma(ma6, 2)
    ma8 = ta.sma(ma7, 2)
    ma9 = ta.sma(ma8, 2)
    ma10 = ta.sma(ma9, 2)
    swingTrd1 = 100 * (source - (ma1 + ma2 + ma3 + ma4 + ma5 + ma6 + ma7 + ma8 + ma9 + ma10) / 10) / (ta.highest(source, swingLength) - ta.lowest(source, swingLength))
    swingTrd2 = ta.ema(swingTrd1, swingEmaLength1)
    swingTrd3 = ta.ema(swingTrd2, swingEmaLength2)
    rmo = ta.ema(swingTrd1, rmoLength)
    buySignal = ta.crossover(swingTrd2, swingTrd3)
    sellSignal = ta.crossunder(swingTrd2, swingTrd3)
    bullTrend = rmo > 0
    bearTrend = rmo < 0
    impulseUp = swingTrd2 > 0
    impulseDown = rmo < 0
    [rmo, swingTrd2, swingTrd3, buySignal, sellSignal, bullTrend, bearTrend, impulseUp, impulseDown]

[p_ind_1_rmo, p_ind_1_swingTrd2, p_ind_1_swingTrd3, p_ind_1_buySignal, p_ind_1_sellSignal, p_ind_1_bullTrend, p_ind_1_bearTrend, p_ind_1_impulseUp, p_ind_1_impulseDown] = p_ta_rmo(close, 10, 30, 30, 81) // RMO

hline(0, title="RMO - Zero Line", color=color.new(#787B86, 50))
p_ind_1_rmo_color = p_ind_1_impulseUp ? color.rgb(76, 175, 80, 0) : p_ind_1_impulseDown ? color.rgb(242, 54, 69, 0) : (p_ind_1_bullTrend ? color.rgb(76, 175, 80, 0) : color.rgb(41, 98, 255, 0))
plot(p_ind_1_rmo, title="RMO - RMO", color=p_ind_1_rmo_color, style=plot.style_columns, linewidth=2)
plot(p_ind_1_swingTrd2, title="RMO - Swing Trend 2", color=color.rgb(255, 152, 0, 0), linewidth=1)
plot(p_ind_1_swingTrd3, title="RMO - Swing Trend 3", color=color.rgb(156, 39, 176, 0), linewidth=1)
p_ind_1_rmo_ribbon_color = p_ind_1_bullTrend ? color.rgb(76, 175, 80, 80) : p_ind_1_bearTrend ? color.rgb(242, 54, 69, 80) : color.rgb(41, 98, 255, 80)
bgcolor(p_ind_1_rmo_ribbon_color, title="RMO - Background Ribbon")

Chart Preview

Rahul Mohindar Oscillator on SPY Daily chart in TradingView showing RMO histogram with green/red columns and dual signal lines

Chart Element Reference

Visual ElementMeaning
Green histogram columnsImpulse Up — swingTrd2 above zero, bullish momentum active
Red histogram columnsImpulse Down — bearish momentum, swingTrd2 below zero
Orange line (swingTrd2)First smoothed EMA signal line — faster reaction to momentum
Purple line (swingTrd3)Second smoothed signal line — crossover with swingTrd2 generates signals
Green/red background ribbonRMO trend bias — green for bullTrend (RMO > 0), red for bearTrend (RMO < 0)

RMO Parameters

ParameterDefault ValueDescriptionRecommended Range
swingLength10Highest/lowest price range lookback for normalization7–20
swingEmaLength130First EMA smoothing applied to the raw swing oscillator15–50
swingEmaLength230Second EMA smoothing applied to swingTrd2 for signal generation15–50
rmoLength81Long EMA for final RMO trend direction — controls the background ribbon50–100

Tuning Scenarios by Trading Style

StyleParametersSignal TypeBest Use
Scalping7,15,15,50Crossovers5M crypto
Swing10,30,30,81Crossovers4H stocks
Position14,40,40,100CrossoversDaily indices

Reading RMO Signals

The RMO produces four main signal types. The most reliable is the impulse signal (green or red histogram), which directly indicates whether short-term momentum is bullish or bearish. I pay closest attention to the impulse reading on 4H charts — it has the highest win rate across stocks and crypto.

SignalConditionMeaningReliability
Impulse UpswingTrd2 > 0 and histogram turns greenStrong bullish momentum, aggressive long entriesHigh on 4H
Impulse DownswingTrd2 < 0 and histogram turns redStrong bearish momentum, aggressive short entriesHigh on 4H
Signal Line Crossover UpswingTrd2 crosses above swingTrd3Bullish swing momentum shiftMedium on Daily
Signal Line Crossover DownswingTrd2 crosses below swingTrd3Bearish swing momentum shiftMedium on Daily

Common misread: A brief green histogram flash on a 15-minute chart is not an impulse signal — it is noise. Wait for at least 3 consecutive bars of the same histogram color on 1H or higher timeframes before acting. The RMO impulse definition requires sustained momentum, not a single bar flip.

I learned this the hard way after three stopped-out trades in a single week back in 2023.

RMO Trading Strategies

The RMO is most effective as an impulse confirmation system in trending markets and as a divergence detector at market turning points. I have found the impulse entry strategy works best on SPY and BTC/USD daily charts. Below are three concrete strategies with entry, exit, and stop-loss rules.

Strategy 1RMO Impulse Entry Strategy

Market environment: Trending markets — 4H, Daily · Combine with ADX(14) > 20 for trend confirmation

  1. Calculate RMO with default params (10, 30, 30, 81) — these are the same settings Rahul Mohindar published.
  2. Add ADX: adxVal = ta.dmi(14, 14) — ADX above 20 means a genuine trend exists.
  3. Long entry: swingTrd2 > 0 (impulse up) AND adxVal > 20 — enter on the green histogram with trend confirmation.
  4. Short entry: swingTrd2 < 0 (impulse down) AND adxVal > 20 — enter on the red histogram with trend confirmation.
  5. Stop-loss: place 1.5x ATR below the entry bar low for longs or above the entry bar high for shorts.
  6. Exit: swingTrd2 crosses swingTrd3 in the opposite direction — the smoothed signal line cross provides the exit trigger.

Strategy 2RMO Zero-Line Trend Continuation

Market environment: Strongly trending markets — Daily, Weekly · Use with 200-period SMA as macro trend filter

  1. Calculate SMA 200: sma200 = ta.sma(close, 200) — defines the primary bull/bear market.
  2. Long setup: RMO crosses above 0 while price is above SMA 200 — bull trend momentum confirmed.
  3. Short setup: RMO crosses below 0 while price is below SMA 200 — bear trend momentum confirmed.
  4. Enter 2–3 bars after the zero-line cross to let the oscillator settle — avoids the repainting window.
  5. Exit: RMO crosses back below 0 for longs (or above 0 for shorts) — the zero line is your trailing exit.

Strategy 3RMO Divergence with MFI

Market environment: Markets approaching exhaustion — 4H, Daily · Pair with Money Flow Index (MFI) for volume-based divergence confirmation

  1. Identify swing points: mark the last 3 significant highs or lows on price and on RMO.
  2. Bullish divergence: price makes a lower low while RMO makes a higher low. MFI rising above 50 confirms it.
  3. Bearish divergence: price makes a higher high while RMO makes a lower high. MFI below 50 confirms it.
  4. Wait for swingTrd2 to cross swingTrd3 in the reversal direction — that crossover is your actual entry trigger.
  5. Target: measure the prior swing height and set a 1:2 risk-to-reward ratio. RMO divergences on Daily tend to resolve over 5–15 bars.
StrategyMarket TypeWin Rate RangeBest PairRisk Level
Impulse EntryTrending58–68%SPYMedium
Zero-Line ContinuationStrong Trend62–72%BTC/USDLow
Divergence + MFIExhaustion55–65%ETH/USDHigh

Disclaimer: The strategies above are for educational purposes only and do not constitute investment advice. Past performance does not guarantee future results. Always apply proper risk management and position sizing.

RMO vs Similar Indicators

The RMO shares conceptual ground with TSI, MACD, and RSI, but its 10-level cascaded SMA and dual signal-line structure make it behave differently in practice. I have used all four extensively and the table below summarizes the trade-offs.

IndicatorTypeAvg LagBest UseSignals/Bar
TSIMomentumMediumDouble-smoothed momentum~2-4
MACDTrend MomentumHighTrend following~1-3
RSIMomentumMediumOverbought/oversold~3-5

RMO has the highest lag of the four — no surprise given the 10-level cascade and triple EMA. But that lag is by design: Mohindar prioritized signal quality over speed. I personally reach for RMO when I want impulse confirmation on 4H+ charts, and switch to CCI or RSI when I need faster entries on intraday timeframes. MACD sits somewhere in the middle — less lag than RMO, more than CCI. The key insight is that RMO and TSI are complements, not substitutes: TSI handles choppy markets better, RMO excels when trends are strong and sustained.

If you are solely trading BTC/USD on daily timeframes, I recommend RMO over RSI or MACD. The cascaded SMA structure filters out the high-frequency noise that crypto daily charts produce, leaving cleaner impulse signals. For EUR/USD or other Forex pairs, TSI performs comparably and sometimes better because Forex moves in smaller, more frequent waves rather than the sustained impulse patterns that RMO is built to capture.

Common RMO Mistakes and How to Fix Them

I have made most of these mistakes myself over the past three years, especially ignoring the swingLength parameter on 4H charts.

  1. 1. Using RMO crossovers without a trend filter

    Why it fails: RMO generates false signals in sideways markets where momentum oscillates around zero without breaking into a sustained trend.

    Fix: Add ADX(14) — only take RMO signals when ADX reads above 20. In ranging markets below 20, the crossover reliability drops below 45%.

  2. 2. Setting rmoLength below 50 for the trend direction

    Why it fails: The rmoLength controls the background ribbon color and long-term bias. A short value makes the ribbon flip constantly, removing its value as a trend filter.

    Fix: Keep rmoLength between 81 and 100. I use 81 on daily charts and 100 on weekly — this gives a stable bias that changes only 2–4 times per year.

  3. 3. Trading every histogram color change on 5-minute charts

    Why it fails: RMO was designed for swing trading on 1H+ timeframes. The 10-level cascaded SMA creates significant lag, and on short timeframes the impulse signals appear and disappear within 1–2 bars.

    Fix: Only trade RMO impulses on 1H charts and above. For 5–15 minute scalping, use a faster momentum indicator like CCI or the raw RSI instead.

  4. 4. Ignoring the swingLength parameter

    Why it fails: swingLength controls the highest/lowest lookback used to normalize the oscillator. A value that is too small clips the oscillator range and suppresses genuine momentum readings.

    Fix: Match swingLength to your expected swing duration. For a 30-bar swing on 4H charts, set swingLength to 30 — this ensures the normalization captures the full price range of the swing.

  5. 5. Using RMO on overlay indicators or second panels

    Why it fails: RMO is a non-overlay oscillator (overlay=false) designed for its own panel. Importing its values into a different panel causes misalignment because the zero line and histogram ranges differ.

    Fix: Always run RMO in its dedicated panel with overlay=false. If combining multiple oscillators, use a separate pane for each or normalize them with the same range logic.

  6. 6. Taking RMO divergence as an immediate entry signal

    Why it fails: Divergence indicates slowing momentum, not an immediate reversal. RMO divergence can persist for 3–10 bars before price follows, and entering early leads to stopped-out trades.

    Fix: Wait for swingTrd2 to cross swingTrd3 after the divergence forms. The crossover confirms momentum has shifted — enter after the cross, not at the divergence print.

How to Generate the RMO Indicator in Pineify

  1. 1

    Open Pineify

    Go to pineify.app and sign in — a free account is sufficient to generate RMO indicators and other Pine Script oscillators.

  2. 2

    Click "New Indicator"

    Select "Indicator" as the script type from the creation menu on the Pineify dashboard.

  3. 3

    Describe the RMO configuration you want

    Type a prompt such as: "Plot a Rahul Mohindar Oscillator with swingLength 10, swingEmaLength1 30, swingEmaLength2 30, and rmoLength 81." Pineify's AI Coding Agent generates the complete Pine Script v6 code in seconds.

  4. 4

    Copy to TradingView

    Click "Copy to TradingView" to copy the generated code, then open the TradingView Pine Script editor (Alt+P), paste the code, and click "Add to chart."

  5. 5

    Adjust the impulse parameters

    In the TradingView indicator settings panel, adjust swingLength, swingEmaLength1, swingEmaLength2, and rmoLength to match your trading style — for example, use 7/15/15/50 for faster 1H signals or 14/40/40/100 for weekly position trading.

I generated this exact RMO script using Pineify in about 20 seconds, and it saved me at least an hour of manual Pine Script debugging.

Frequently Asked Questions

Rahul Mohindar Oscillator in Seconds

Skip the manual coding. Pineify's AI Coding Agent generates complete, ready-to-use Pine Script indicators — including the Rahul Mohindar Oscillator with impulse signals, dual signal-line crossovers, and trend divergence detection — instantly for free.

Try Pineify Free