Concept

Firefly Oscillator

Firefly Oscillator is a Momentum & Oscillators concept. The Library holds 1 implementation — a working definition you can pull into Quant.

Top Firefly Oscillator indicator

The top custom implementation, built on the original standard Firefly Oscillator formula.

1 total

What is the Firefly oscillator?

The Firefly oscillator is a momentum indicator that measures how far a weighted price sits from its own recent average, in units of recent variability, and then double-smooths that reading into a 0 to 100 line centered on 50. At its core it is a smoothed z-score: price stretched well above its norm produces high readings, price stretched below produces low ones, and the smoothing turns the raw statistical series into a swing-friendly curve. The name comes from the way plotted implementations often flare (light up) at momentum extremes.

The indicator circulated through trading forums and community script libraries rather than a book or journal, so no single authoritative specification exists; the widely copied charting implementations share the same pipeline of weighted price, z-score, zero-lag style double smoothing, and rescaling. It belongs to the same design family as other normalized-and-smoothed oscillators in which a statistical deviation measure is dressed up for visual swing trading.

Traders use it as a bounded momentum and exhaustion gauge: the normalization adapts automatically to each market's volatility, and the aggressive smoothing produces rounded swings whose turns are easy to read, at the usual cost of added lag.

How it's calculated

A weighted price is converted to a z-score against its own average and deviation, double-smoothed with a zero-lag adjustment, and rescaled to 0 to 100. Implementations vary; this is the common form.

WP_t = (high_t + low_t + 2 * close_t) / 4
basis_t = EMA(WP, m)
dev_t = stdev(WP, m)
Z_t = 100 * (WP_t - basis_t) / dev_t
ZS_t = 2 * EMA(Z, w) - EMA(EMA(Z, w), w)
Firefly_t = (ZS_t + 100) / 2
t: current bar index
WP_t: weighted price giving the close double weight
m: lookback for the basis and deviation (default 10)
basis_t: EMA of the weighted price over m bars
dev_t: standard deviation of the weighted price over m bars
Z_t: deviation of weighted price from its basis, scaled by 100
w: smoothing length for the double EMA pass (default 3)
ZS_t: zero-lag style double-smoothed z-score
Firefly_t: final reading rescaled so 50 is neutral, roughly 0 to 100

There is no canonical published source; community implementations differ in the weighted price definition, smoothing lengths, and whether the zero-lag adjustment is applied.

Because the underlying z-score is theoretically unbounded, extreme bars can push readings slightly outside 0 to 100 in some implementations.

How traders use it

  • As an exhaustion gauge in ranges: readings stretched toward the top or bottom of the scale mark statistically unusual displacement from the recent mean, and swing traders fade them back toward 50 when no trend regime is in force.
  • As a momentum confirmation tool: crosses of the 50 midline in the direction of the prevailing trend are used as continuation triggers, similar to centerline logic on other bounded oscillators.
  • For divergence reading: the heavy smoothing makes swing highs and lows on the oscillator well defined, so comparing their sequence against price extremes is straightforward.
  • Its limitations are the short default windows and lack of a standard: a 10-bar deviation basis makes readings twitchy on noisy instruments, different platform versions disagree in detail, and like the wave trend oscillator it can hug an extreme throughout a strong trend, punishing anyone who fades it mechanically.

Firefly oscillator vs statistical and smoothed relatives

Z-score: A raw z-score of price is the statistical core of the Firefly, unsmoothed and unbounded. The Firefly wraps it in a weighted price input, double smoothing, and a 0 to 100 rescale, trading statistical purity for chart readability.

Wave trend oscillator: The wave trend oscillator follows an almost parallel recipe, normalizing a typical-price deviation by mean absolute deviation and double-smoothing with EMAs. The two often look similar; the Firefly's standard deviation denominator and zero-lag pass make it slightly snappier in most implementations.

RSI: RSI normalizes by the balance of up versus down closes, not by dispersion, so it measures directional persistence rather than statistical stretch. The Firefly can read extreme after one violent bar; RSI needs a run of one-sided closes to get there.

Concept family

Momentum & Oscillators

91 concepts mapped · 91 in the Library

Firefly Oscillator FAQ

Who created the Firefly oscillator?

Its origin is community trading forums and shared charting scripts rather than a published book or journal article, and no definitive author attribution exists. Treat any specific implementation as one variant of a shared recipe.

What do readings above 80 or below 20 mean?

They indicate the weighted price is unusually far from its recent average in volatility-adjusted terms. In ranges that argues for mean reversion; in trends the oscillator can stay extreme for many bars, so a regime check should come first.

Why do different platforms show different Firefly values?

There is no canonical specification, so scripts differ in the price input, smoothing lengths, and zero-lag adjustment. The swings usually align even when levels do not, which is why most users trade its shape rather than exact values.

Is the Firefly better than a plain z-score of price?

It is easier to read but slower. The smoothing removes the one-bar noise that makes raw z-scores hard to trade, at the cost of a few bars of lag and the loss of exact statistical interpretation.

Build Firefly Oscillator your way.

Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.