Firefly Oscillator
By LuxAlgoJun 8, 2026
Firefly Oscillator is an indicator on Vela, our next-generation charting platform, written in Pine Script®.
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
Free to use
Run it on Vela. Go further with a paid plan.
- Up to 500 Custom Alerts, with webhook automation
- Up to 10× the chart history of Free
- Orderflow lookback up to full history
- More Quant usage to customize it, plus extra usage when you need it
- Futures data alongside crypto, stocks, forex and commodities
Related indicators
Run it on Vela. Make it yours with Quant.
Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.





