All indicators
Momentum / Own pane

Fisher Transform

Ehlers' Fisher Transform of the median price's position in its recent range, with a one-bar trigger line.

  • Fisher
  • Built into Spectral
  • Updates every tick
  • fisher transform
  • ehlers
  • trigger line
  • turning points
  • momentum
  • oscillator

By Spectral · v1.0.0

MIT-0: free to use, change and share, no attribution needed. What you build from it is yours.

Already in Spectral: add it from the Indicators toolbox. The file here is the same indicator written as a custom indicator, to change or learn from. Installed, it appears next to the built-in one, marked Custom.

Fisher Transform on a Spectral chart
Spectral chart with sample market data, default settings.

Overview

The Fisher Transform (John Ehlers) takes the median price, (high + low) / 2, measures its position inside the range of the last Length bars on a -1 to +1 scale, smooths it, and applies the Fisher transform, which stretches values near the ends of the range. Turning points become sharp, clear swings. The trigger line is the Fisher value of the previous bar.

How to read it

Readings far from zero mark price at an extreme of its recent range; the sharp turns that follow are the indicator's main use. The Fisher line crossing its trigger shows the turn: crossing down from above the upper bands suggests a swing high, crossing up from below the lower bands a swing low.

It has no fixed upper or lower limit, and in a steady trend it can stay on one side of zero for a long time. Use the bands as a guide to how stretched a move is, not as fixed overbought and oversold levels.

Settings and limitations

Length defaults to 9 bars, as on TradingView. Shorter lengths give more swings. Reference bands sit at 1.5 and 0.75 above and below zero. The first value appears on bar Length (bar 9 with the default) and settles over the next few bars, because each value builds on the previous one.

Notes

Matches the Fisher Transform on TradingView: position = 0.66 x (scaled position - 0.5) + 0.67 x previous position, with anything beyond 0.99 set to 0.999, and Fisher = 0.5 x ln((1 + position) / (1 - position)) + 0.5 x previous Fisher. A bar whose window has no range has no value, and the next bar starts again from zero, as on TradingView.

Settings

Each setting appears in the indicator's settings panel in Spectral, next to a color setting for every output.

SettingTypeDefaultRange or optionsWhat it does
LengthWhole number91 – 500Bars in the high-low range of the median price.
Outer bandsNumber1.50 – 10, step 0.25Distance of the outer reference bands above and below zero.
Inner bandsNumber0.750 – 10, step 0.25Distance of the inner reference bands above and below zero.

What it draws

Lines

  • Fishersolid · 1.5 px · primary#8AA9C3
  • Triggersolid · 1 px#C4A46A

Levels

  • Upper outer banddashed · 1 px#788493
  • Upper inner banddotted · 1 px#788493
  • Zero linedotted · 1 px#788493
  • Lower inner banddotted · 1 px#788493
  • Lower outer banddashed · 1 px#788493

Source

Save it as fisher-transform.js and add it with Indicators → Custom indicators → Add file…. The format is explained in the custom indicators guide.

// Copyright (c) 2026 Spectral
// SPDX-License-Identifier: MIT-0
// Free to use, copy, modify and share: https://spectral.trade/docs/custom-indicators/LICENSE.txt
/** @type {import('./spectral-indicator').IndicatorV2} */
export default {
  schemaVersion: 2,
  id: 'fisher-transform',
  name: 'Fisher Transform',
  shortName: 'Fisher',
  version: '1.0.0',
  author: 'Spectral',
  description: 'Ehlers\' Fisher Transform of the median price\'s position in its recent range, with a one-bar trigger line.',
  pane: 'oscillator',
  live: { lookback: 'length' },
  inputs: {
    length: { type: 'integer', label: 'Length', default: 9, min: 1, max: 500, description: 'Bars in the high-low range of the median price.' },
    outerBand: { type: 'number', label: 'Outer bands', default: 1.5, min: 0, max: 10, step: 0.25, description: 'Distance of the outer reference bands above and below zero.' },
    innerBand: { type: 'number', label: 'Inner bands', default: 0.75, min: 0, max: 10, step: 0.25, description: 'Distance of the inner reference bands above and below zero.' },
  },
  plots: {
    fisher: { label: 'Fisher', color: '#8AA9C3', lineWidth: 1.5, primary: true },
    trigger: { label: 'Trigger', color: '#C4A46A', lineWidth: 1 },
  },
  levels: {
    upperOuter: { label: 'Upper outer band', color: '#788493', lineStyle: 'dashed' },
    upperInner: { label: 'Upper inner band', color: '#788493', lineStyle: 'dotted' },
    zero: { label: 'Zero line', color: '#788493', lineStyle: 'dotted' },
    lowerInner: { label: 'Lower inner band', color: '#788493', lineStyle: 'dotted' },
    lowerOuter: { label: 'Lower outer band', color: '#788493', lineStyle: 'dashed' },
  },
  docs: {
    overview: 'The Fisher Transform (John Ehlers) takes the median price, (high + low) / 2, measures its position inside the range of the last Length bars on a -1 to +1 scale, smooths it, and applies the Fisher transform, which stretches values near the ends of the range. Turning points become sharp, clear swings. The trigger line is the Fisher value of the previous bar.',
    howToRead: 'Readings far from zero mark price at an extreme of its recent range; the sharp turns that follow are the indicator\'s main use. The Fisher line crossing its trigger shows the turn: crossing down from above the upper bands suggests a swing high, crossing up from below the lower bands a swing low.\n\nIt has no fixed upper or lower limit, and in a steady trend it can stay on one side of zero for a long time. Use the bands as a guide to how stretched a move is, not as fixed overbought and oversold levels.',
    settings: 'Length defaults to 9 bars, as on TradingView. Shorter lengths give more swings. Reference bands sit at 1.5 and 0.75 above and below zero. The first value appears on bar Length (bar 9 with the default) and settles over the next few bars, because each value builds on the previous one.',
    notes: 'Matches the Fisher Transform on TradingView: position = 0.66 x (scaled position - 0.5) + 0.67 x previous position, with anything beyond 0.99 set to 0.999, and Fisher = 0.5 x ln((1 + position) / (1 - position)) + 0.5 x previous Fisher. A bar whose window has no range has no value, and the next bar starts again from zero, as on TradingView.',
  },
  calculate(ctx) {
    const { bars, inputs, ta } = ctx;
    const median = bars.map((bar) => (bar.high + bar.low) / 2);
    const highest = ta.highest(median, inputs.length);
    const lowest = ta.lowest(median, inputs.length);
    const items = median.map((value, index) => ({ value, high: highest[index], low: lowest[index] }));
    // The smoothed position and the previous Fisher value carry from bar to bar through ta.scan.
    const initial = { position: 0, previous: null, fisher: null, trigger: null };
    const states = ta.scan(items, initial, (state, { value, high, low }) => {
      if (high === null || low === null) return { ...state, fisher: null, trigger: null };
      // No range: no value, and the recursion starts again from zero on the next bar (TradingView's nz()).
      if (high === low) return { position: 0, previous: null, fisher: null, trigger: state.previous };
      const next = 0.66 * ((value - low) / (high - low) - 0.5) + 0.67 * state.position;
      const position = next > 0.99 ? 0.999 : next < -0.99 ? -0.999 : next;
      const fisher = 0.5 * Math.log((1 + position) / (1 - position)) + 0.5 * (state.previous ?? 0);
      return { position, previous: fisher, fisher, trigger: state.previous };
    });
    const fisher = states.map((state) => state.fisher);
    const trigger = states.map((state) => state.trigger);
    return {
      plots: { fisher, trigger },
      levels: {
        upperOuter: inputs.outerBand,
        upperInner: inputs.innerBand,
        zero: 0,
        lowerInner: -inputs.innerBand,
        lowerOuter: -inputs.outerBand,
      },
    };
  },
};

Adapt it with an LLM

Paste this into your assistant and replace the second-to-last line with the change you want.

Start from this Spectral custom indicator: https://spectral.trade/indicators/fisher-transform.js
Format reference: https://spectral.trade/docs/custom-indicators.llm.md
Keep the file format and every rule of the reference; give the result a new id, name, shortName and version, and update docs and input descriptions to match.
Keep its live updates exact and fast (section "Fast live updates" of the reference): carry values from bar to bar only through ctx.ta, and raise live.lookback if the change reads further back; Spectral rejects a file whose live updates differ from a full recalculation or are too slow.
Change I want: <describe the change>
Answer with the complete file in one code block, ready to save as <id>.js.