All indicators

Firefly Oscillator

By LuxAlgoJun 8, 2026

Static chart image

Firefly Oscillator renders the community-bred momentum gauge in fully specified form — a first faithful implementation of the Firefly oscillator recipe. A weighted price that double-counts the close is converted to a z-score against its own EMA basis and standard deviation, double-smoothed with a zero-lag pass, and rescaled so 50 is neutral on a roughly 0-100 scale. The line is bullish-colored above the midline and bearish below, a gradient fill anchors it to 50, and the optional glow flares as readings stretch — the flaring the oscillator is named for.

How to Trade the Firefly Oscillator?

  • Midline crosses: a cross of 50 flips the volatility-adjusted stretch from one side of the basis to the other; both directions carry alerts.
  • Overbought and oversold: pushes beyond the dashed 80 and 20 levels mark statistically stretched readings, and the fades back through them carry their own alerts.
  • Divergences: with detection on, price printing a fresh extreme while the oscillator prints a lesser one draws a line between the two swings, tagged Bullish or Bearish.

Because the z-score underneath is unbounded, violent bars can push readings slightly past 0 or 100 — stretch, not error.

Firefly Oscillator Settings

  • Basis Length (default 10): lookback shared by the EMA basis and the deviation of the weighted price; shorter reads twitchier.
  • Smoothing Length (default 3): EMA length of the zero-lag double smoothing pass.
  • Overbought (default 80) and Oversold (default 20): the stretched-reading levels.
  • Show Divergences (default off) with Pivot Lookback (default 5) and Max Pivot Distance (default 60): swing confirmation and the widest allowed gap between swings.
  • Glow Effect (default on): the halo that intensifies toward the extremes.

Frequently Asked Questions

How does the Firefly compare to the CCI?

Both measure displacement from a moving basis, but the Commodity Channel Index scales by mean absolute deviation and stays unbounded, while the Firefly scales by standard deviation, double-smooths and rescales to a bounded read — trading statistical rawness for a rounder, swing-friendly curve.

Do the divergence drawings repaint?

A swing must survive Pivot Lookback bars on each side before it exists, so divergence lines appear with that confirmation delay, then stay put. The usual trade-off: fewer false swings, later notice.

Why does my Firefly differ from other versions?

No canonical specification exists, so variants disagree on price input, lengths and smoothing details. This build fixes one coherent pipeline — weighted price, z-score, zero-lag pass, rescale — and exposes every parameter.

Original indicatorBuilt in-house by LuxAlgo

The Library is free. Quant makes it yours.

Pull any concept or indicator into Quant: rebuild it, retune it, or turn it into a backtested strategy of your own.