Indicators/probuilder · probacktest · proorder · proscreener

Repulse

Repulse in ProBuilder measures the bullish or bearish pressure exerted on each candlestick over n bars, oscillating around zero. Syntax, formula, examples.

Syntax

probuilder
Repulse[n](price)

Parameters

NameTypeDefaultDescription
nintegernoneNumber of bars analysed. Small values such as 1 to 5 read the pressure on individual candles, larger values such as 15 or more describe the broader wave.
priceprice sourcecloseThe price series used in the calculation. Usually close, also accepts open, high, or low.

Formula

The commonly cited definition compares an upward force against a downward force, each expressed as a percentage of the close and smoothed exponentially:

code
up   = 100 * (3 * close - 2 * lowest low over n - open) / close
down = 100 * (open + 2 * highest high over n - 3 * close) / close
Repulse = ExponentialAverage[5n](up) - ExponentialAverage[5n](down)

The upward force grows when the close settles far above the recent lows, the downward force grows when the close settles far below the recent highs. Their smoothed difference oscillates around zero.

How it works

Repulse tries to answer a candlestick question numerically: over the last n bars, who pushed harder, buyers or sellers. A candle that opens low and closes near the top of its recent range shows buyers absorbing supply, which raises the bullish component. The mirror case raises the bearish component. Netting the two produces a single line whose sign summarises which side is winning.

The indicator behaves like other zero-centred oscillators. The sign gives the bias, the slope gives the change in pressure, and divergences against price warn that the current move is running out of participants. Because the smoothing period scales with n (five times the analysis window), larger n values produce noticeably slower, smoother lines.

A common technique runs several instances at once, for example Repulse[1], Repulse[5] and Repulse[15], to read short, intermediate and longer pressure waves on the same chart. Alignment of all three on one side of zero is treated as a higher-conviction reading than any single line.

Examples

Example 1, Bullish and bearish pressure flags (Indicator)

probuilder
i1 = Repulse[10](close)
IF i1 > 0 THEN
  bullish = 1
  bearish = 0
ELSIF i1 < 0 THEN
  bullish = 0
  bearish = 1
ENDIF
RETURN bullish coloured(127,255,0), bearish coloured(255,64,64)

Converts the 10-bar Repulse into two binary flags, drawn green for bullish pressure and red for bearish pressure. Note that when i1 equals exactly zero, both flags keep their previous values because variables persist across bars.

Example 2, Zero-cross entry with trend filter (ProOrder)

probuilder
DEFPARAM CumulateOrders = false

pressure = Repulse[5](close)
trend    = Average[100](close)

// Buy when pressure turns positive in an established uptrend
IF NOT LongOnMarket AND close > trend AND pressure CROSSES OVER 0 THEN
  BUY 1 CONTRACT AT MARKET
ENDIF

// Exit when pressure flips negative
IF LongOnMarket AND pressure CROSSES UNDER 0 THEN
  SELL AT MARKET
ENDIF

The 100-bar average keeps entries on the trend side, and the Repulse zero cross times the entry to the moment buying pressure retakes control.

Example 3, Multi-period pressure alignment (ProScreener)

probuilder
shortP = Repulse[1](close)
midP   = Repulse[5](close)
longP  = Repulse[15](close)
aligned = shortP > 0 AND midP > 0 AND longP > 0
SCREENER[aligned](midP AS "Repulse 5")

Returns instruments where the 1, 5 and 15 bar Repulse readings are all positive, the alignment condition often used as a bullish confirmation.

Interpretation

ReadingMeaning
Repulse > 0Net bullish pressure over the window.
Repulse < 0Net bearish pressure over the window.
Rising through 0Buyers taking control, momentum shift up.
Falling through 0Sellers taking control, momentum shift down.
Divergence vs priceNew price extreme without a new oscillator extreme, pressure behind the move is fading.

Repulse readings are relative, not bounded, so extreme values differ by instrument and by n. It is normally read for sign, slope and divergence rather than absolute level, and confirmed with volume or support and resistance context.

Common errors and gotchas

  • Smoothing scales with the period. The internal exponential smoothing uses a multiple of n, so doubling n more than doubles the lag. A Repulse[15] line reacts much later than intuition based on a 15-bar lookback suggests.
  • No fixed bounds. Unlike RSI or Stochastic there are no universal overbought or oversold levels. Thresholds such as > 20 must be calibrated per instrument and timeframe.
  • Zero-cross whipsaw on small n. Repulse[1] changes sign frequently in quiet markets. Trading raw zero crossings without a trend filter generates a stream of losing round trips.
  • Unhandled equality case. In branch logic like Example 1, a value of exactly zero matches neither > 0 nor < 0, so flag variables silently retain the previous bar's value. Add an ELSE branch when a defined state is required on every bar.
  • RepulseMM, moving-average variant taking short, long and smoothing parameters.
  • SmoothedRepulse, pre-smoothed version of the same concept.
  • RSI, bounded momentum oscillator with fixed 0 to 100 scale.
  • Stochastic, bounded oscillator locating the close within its recent range.
  • CCI, deviation-from-average oscillator with comparable zero-centred reading.
  • Momentum, raw price difference over N bars.
  • ROC, percentage rate of change of price.
  • ExponentialAverage, the smoothing method used inside Repulse.