Bentrix Docs
HomePricingDashboard

Fisher Transform

Oscillatorsoscillator2 linesin every package

The median price's place in its recent range, mapped through the inverse hyperbolic tangent so that extremes stand out as sharp peaks, with its previous value as the trigger line.

It reports the transformed position and its trigger.

01The study, live

Live figureScroll to zoom, drag the bars to pan.
-1.501.5
bar —O — H — L — C —main line —signal —first value at —
Show where:

Computed by Bentrix’s own code over the same synthetic bars on every page — an illustration of how the study behaves, not a market.

What this figure shows

The figure is computed over 300 sample bars. Fisher has no value on the first 9 — the bars it needs before it can answer — and its first value stands on bar 10. Its line runs between -7.25 and 4.55 on these bars, and the last value is 0.5963. Counting the conditions the study declares on these bars: crosses above -1.5 6 times; crosses below -1.5 6 times; crosses above 0 5 times; crosses below 0 5 times; crosses above 1.5 8 times; crosses below 1.5 8 times; crosses above its signal line 27 times; crosses below its signal line 28 times. Press a condition under the figure to see each place marked. As states rather than moments: is above -1.5 on 195 bars; is below -1.5 on 96 bars; is above 0 on 147 bars; is below 0 on 144 bars; is above 1.5 on 85 bars; is below 1.5 on 206 bars.

02Its parts, named

The bars it readseach bar's open, high, low and closeWarm-upno value on the first 9 bars: thestudy needs them before it cananswerThe second linedrawn with the main line: its signalor its partnerThe main linethe study's own value on each barLevel 1.5a fixed reference the study is readagainstThe zero linethe centre line: where the studychanges signLevel -1.5a fixed reference the study is readagainst
Computed by Bentrix’s own code over the sample bars. It is drawn on once, as you reach the figure.

03What you see

An oscillator with sharp, clear turning points, and a signal line one bar behind.

Fisher is two lines in a pane of its own: the transform and its trigger, the same line one bar later. Levels are drawn at −1.5, 0 and +1.5. The line has no fixed ends: it stretches further the longer price stays at one edge of its recent range, and snaps back quickly when price leaves it.

04Where it comes from

John Ehlers applied the statistical Fisher transform to price to make its distribution closer to normal, so that extremes stand out.

05The formula

Price's position in its recent range, x∈(−1,1), is transformed:

F=12ln(1+x1−x)
xprice's position in its recent range, between −1 and +1
Fthe Fisher transform of it

06A worked example

Take a period of 10. The bar's median price is 101.50; over the last 10 bars the median price ranged from 100.00 to 102.00.

Its position in the range is (101.50 − 100.00) / (102.00 − 100.00) = 0.75; moved to the scale −1 … +1 that is 2 × (0.75 − 0.5) = 0.50.

It is smoothed against the previous smoothed value (say 0.30): 0.67 × 0.30 + 0.33 × 0.50 = 0.366.

The Fisher transform stretches that value: 0.5 × ln((1 + 0.366) / (1 − 0.366)) = 0.5 × ln(2.155) = 0.384; half of the previous Fisher value (say 0.25) is added: 0.509.

The stretching is mild in the middle and violent at the ends: an input of 0.366 gives 0.384, but an input of 0.95 gives 1.83 and 0.99 gives 2.65. That is what makes the line's turns at extremes look sharp.

On real bars: take eight that rise steadily, with highs 21, 22, 24, 24, 25, 26, 26, 27 and lows 18, 19, 20, 21, 21, 23, 23, 23, and a period of 3. Every bar's median price is at or near the top of its 3-bar range, so the line keeps stretching: it reads 2.61 on the last bar, and the trigger — the line one bar earlier — 2.18.

07Built in Assay

The same study written in Assay, Bentrix’s script language, and drawn by Bentrix itself as the script’s graph: each block is one step of the formula. On the ladder the steps stand in the script’s order, one a row; on the board each wire carries a value from the block that gives it to the block that reads it, left to right. The script computes exactly what the study computes — Bentrix checks the two against each other, candle by candle.

THE SCRIPT’S GRAPH
//@version=6
indicator("Fisher Transform")
length = input.int(10, "Length")
price = hl2
highest = ta.highest(price, length)
lowest = ta.lowest(price, length)
// Where the middle price sits in the window's range, from 0 to 1.
ratio = highest - lowest == 0 ? 0.5 : (price - lowest) / (highest - lowest)
var float smoothed = 0.0
var float fisher = na
var float trigger = na
if bar_index >= length - 1
    // That position moved to -1 .. +1 and smoothed, kept just inside the edges.
    smoothed := 0.67 * smoothed + 0.33 * 2 * (ratio - 0.5)
    smoothed := smoothed > 0.99 ? 0.999 : smoothed < -0.99 ? -0.999 : smoothed
    previous = nz(fisher, 0.0)
    // The trigger is the Fisher line one bar back.
    trigger := previous
    // The Fisher transform stretches values near the edges; half of the last value is added.
    fisher := 0.5 * math.log((1 + smoothed) / (1 - smoothed)) + 0.5 * previous
plot(fisher, "Fisher")
plot(trigger, "Trigger")

Paste it into the Assay IDE to put it on a chart, or to change it. Looking at the graph is free in every package; editing it as blocks is Plus.

08Readings — what traders look for

Turns of the line and its crossing of the signal are read as price's position in its range changing direction; large values as price unusually near the edge of its range.

How the sharp turns fail. Ehlers' premise is that the transformed values are roughly normally distributed, so extremes are rare and turns from them clear. The input is a position in a recent range; in a trend it sits at one end and the transform magnifies that into a large value that says no more than a stochastic at 100.

How the trigger crossing fails. The trigger is the line one bar back, so a crossing is simply the line turning — every turn, small ones included.

09In different markets and timeframes

The Fisher transform stretches a price's position in its range so that extremes stand out and turns look sharp. In a trend the input sits at one end and the output is large and uninformative.

10With other studies

Read with its one-bar-back trigger, and beside the stochastic it is a stretched form of.

11What it does not tell you

!

The transform stretches the extremes; it does not add information the range did not hold.

12Inputs and defaults

Fisher (10, Chart)settings card
1Time Period10
2TimeframeChart
3Wait for the candle to closeOn
  1. 1
    Time Period — 10Time period
  2. 2
    Timeframe — ChartThe chart's own by default; any higher one, read on the last closed candle. A finer one is never offered.
  3. 3
    Wait for the candle to close — OnThe value of a higher timeframe is taken only from a candle that has finished.

What each input changes

  • Time PeriodThe window in which the bar's median price is placed. Shorter: the input reaches ±1 more often and the line spikes more.
  • In use10 is Ehlers'.

13Limits and common misreadings

Unbounded, though clipped just inside ±1 before the transform.

No fixed levels: what is extreme depends on the period.

14Conditions an alert or a strategy can watch

crosses above -1.5 eventcrosses below -1.5 eventis above -1.5 stateis below -1.5 statecrosses above 0 eventcrosses below 0 eventis above 0 stateis below 0 statecrosses above 1.5 eventcrosses below 1.5 eventis above 1.5 stateis below 1.5 statecrosses above its signal line eventcrosses below its signal line eventis above its signal line stateis below its signal line state

Event: the bar it happens on an event happens on one barState: every bar while it holds a state holds on every bar while it lasts

These are the conditions the study itself declares — the same rules the alert editor and the strategy engine read, and the ones the figure's chips show.

15Practise it in the laboratory

Put the Fisher Transform 10 and a Stochastic 10 in two panes: the first is a stretched version of the second. Note what the stretching does near the ends of the scale.

Open the laboratory

17In Bentrix

  • From the menu: a chart's Indicators button › Oscillators › Fisher, or type Fisher in its search.
  • Its settings: the settings card opens when it is added; its legend's name opens it again.

18From an agent or a program

Two tools reach it. study_values computes it over a workbench’s candles up to the clock — no chart needed — and study_attach puts it on a chart, where it is drawn and saved with the chart ({"chart": "<chart uri>", "kind": "fisher"}).

The study, as a chart files it

This is a new Fisher’s entry — its kind, its calculation, the price it reads and its settings. Change a setting here to read it with other inputs.

{
  "applied": "close",
  "convention": "talib",
  "kind": "fisher",
  "settings": {
    "shape": "ta",
    "values": {
      "optInTimePeriod": 10.0
    }
  }
}

An agent

An agent calls the MCP tool with it:

{
  "name": "study_values",
  "arguments": {
    "bench": "bentrix://lab/\u2026/bench/\u2026",
    "symbol": "EURUSD",
    "timeframe": "H1",
    "limit": 5,
    "study": {
      "applied": "close",
      "convention": "talib",
      "kind": "fisher",
      "settings": {
        "shape": "ta",
        "values": {
          "optInTimePeriod": 10.0
        }
      }
    }
  }
}

A program

A program does the same in its language — bench and market as in the built-in indicators guide:

Python

values = client.study.values(bench, market, "H1", {"applied": "close", "convention": "talib", "kind": "fisher", "settings": {"shape": "ta", "values": {"optInTimePeriod": 10.0}}}, limit=5)
print("times:", values["times"])
for line in values["lines"]:
    print("line:", line["line"])
    print("  newest values:", line["values"])

JSJavaScript

const values = await client.study.values({ bench, symbol: market, timeframe: "H1", study: { "applied": "close", "convention": "talib", "kind": "fisher", "settings": { "shape": "ta", "values": { "optInTimePeriod": 10.0 } } }, limit: 5 });
console.log("times:", values.times);
for (const line of values.lines) {
  console.log("line:", line.line);
  console.log("  newest values:", line.values);
}

C#C#

var values = await client.Study.Values(bench, market, "H1", new Dictionary<string, object?> { ["applied"] = "close", ["convention"] = "talib", ["kind"] = "fisher", ["settings"] = new Dictionary<string, object?> { ["shape"] = "ta", ["values"] = new Dictionary<string, object?> { ["optInTimePeriod"] = 10.0 } } }, limit: 5);
Console.WriteLine($"times: {values!["times"]!}");
foreach (var line in values!["lines"]!.AsArray())
{
    Console.WriteLine($"line: {line!["line"]!}");
    Console.WriteLine($"  newest values: {line!["values"]!}");
}

GOGo

values := must(client.Study.Values(ctx, mcp.StudyValuesArgs{Bench: bench, Symbol: market, Timeframe: "H1", Study: map[string]any{"applied": "close", "convention": "talib", "kind": "fisher", "settings": map[string]any{"shape": "ta", "values": map[string]any{"optInTimePeriod": 10.0}}}, Limit: mcp.Ptr[int64](5)}))
fmt.Println("times:", at(values, "times"))
for _, line := range at(values, "lines").([]any) {
	fmt.Println("line:", at(line, "line"))
	fmt.Println("  newest values:", at(line, "values"))
}

Java

Object values = client.study.values(new Bentrix.StudyApi.ValuesArgs(bench, market, "H1", obj("applied", "close", "convention", "talib", "kind", "fisher", "settings", obj("shape", "ta", "values", obj("optInTimePeriod", 10.0)))).limit(5L));
System.out.println("times:" + " " + at(values, "times"));
for (Object line : (List<Object>) at(values, "lines")) {
    System.out.println("line:" + " " + at(line, "line"));
    System.out.println("  newest values:" + " " + at(line, "values"));
}

C++C++

auto values = client.study.values_(StudyApi::ValuesArgs(bench, market, "H1", Json::Object{{"applied", "close"}, {"convention", "talib"}, {"kind", "fisher"}, {"settings", Json::Object{{"shape", "ta"}, {"values", Json::Object{{"optInTimePeriod", 10.0}}}}}}).limit(5));
std::cout << "times:" << " " << values["times"].dump() << std::endl;
for (const Json &line : values["lines"].arr()) {
    std::cout << "line:" << " " << line["line"].dump() << std::endl;
    std::cout << "  newest values:" << " " << line["values"].dump() << std::endl;
}

Julia

values = client.study.values(bench, market, "H1", Dict{String,Any}("applied" => "close", "convention" => "talib", "kind" => "fisher", "settings" => Dict{String,Any}("shape" => "ta", "values" => Dict{String,Any}("optInTimePeriod" => 10.0))); limit = 5)
println("times:", " ", values["times"])
for line in values["lines"]
    println("line:", " ", line["line"])
    println("  newest values:", " ", line["values"])
end

RR

values <- client$study$values(bench, market, "H1", list(applied = "close", convention = "talib", kind = "fisher", settings = list(shape = "ta", values = list(optInTimePeriod = 10.0))), limit = 5)
cat("times:", format(values$times), "\n")
for (line in values$lines) {
  cat("line:", format(line$line), "\n")
  cat("  newest values:", format(line$values), "\n")
}

RRust

let values = client.study().values(mcp::StudyValuesArgs::new(bench.clone(), market.clone(), "H1", serde_json::json!({"applied": "close", "convention": "talib", "kind": "fisher", "settings": {"shape": "ta", "values": {"optInTimePeriod": 10.0}}})).limit(5))?;
println!("times: {}", values["times"]);
for line in values["lines"].as_array().into_iter().flatten() {
    println!("line: {}", line["line"]);
    println!("  newest values: {}", line["values"]);
}

Reading the answer

  • times — the candles’ open times, in milliseconds since 1970 (UTC), oldest first.
  • lines — one entry per line, in this order, each with its line name and its values; values[i] belongs to the candle at times[i].
  • The last value is the candle at the clock’s, which may still be forming: it changes until that candle closes, as on the chart. Nothing after the clock is ever computed.
  • null is a candle with no value yet — the warm-up, about 1 × the period at the start of the history.
  • Its fixed levels, drawn on the chart: [-1.5, 0.0, 1.5].
lineWhat it is
Mainthe indicator's own value
Signala smoothing of the main line, drawn beside it

In a strategy

Filed under a key of your choice in a strategy document’s studies — here fisher: {"fisher": {"applied": "close", "convention": "talib", "kind": "fisher", "settings": {"shape": "ta", "values": {"optInTimePeriod": 10.0}}}} — its rules can name:

WriteWhat it is
fisherits main line, as a value in a compare
fisher.signalthis line, as a value in a compare
{"cond": "fisher:level.cross_up:-1.5"}a condition it declares itself
{"cond": "fisher:level.cross_down:-1.5"}a condition it declares itself
{"cond": "fisher:level.above:-1.5"}a condition it declares itself
{"cond": "fisher:level.below:-1.5"}a condition it declares itself
{"cond": "fisher:level.cross_up:0"}a condition it declares itself
{"cond": "fisher:level.cross_down:0"}a condition it declares itself
{"cond": "fisher:level.above:0"}a condition it declares itself
{"cond": "fisher:level.below:0"}a condition it declares itself
{"cond": "fisher:level.cross_up:1.5"}a condition it declares itself
{"cond": "fisher:level.cross_down:1.5"}a condition it declares itself
{"cond": "fisher:level.above:1.5"}a condition it declares itself
{"cond": "fisher:level.below:1.5"}a condition it declares itself
{"cond": "fisher:signal.cross_up"}a condition it declares itself
{"cond": "fisher:signal.cross_down"}a condition it declares itself
{"cond": "fisher:signal.above"}a condition it declares itself
{"cond": "fisher:signal.below"}a condition it declares itself

19Sources

  1. Ehlers, John F. Cybernetic Analysis for Stocks and Futures. Wiley, 2004.
  2. Ehlers, John F. "Using the Fisher Transform." Technical Analysis of Stocks & Commodities, November 2002.

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed