Skip to content

Fisher Transform ​

Gaussian transform of price within its range, with a trigger line.

Kind indicator · Drawn in its own pane

Try it ​

On the chart, press / and choose Fisher Transform under Oscillators. To change it, copy the source below into the AlphaScript editor.

Inputs ​

InputTypeDefault
Lengthint9
Fisher colorcolor"#2962FF"
Trigger colorcolor"#FF6D00"

Source ​

From packages/alphascript/indicators/fisher.as.js.

js
indicator({ name: "Fisher Transform", shortTitle: "Fisher", overlay: false, precision: 2 });
const length = input.int("Length", 9, { min: 1 });
const hl2 = ta.calc([candle.high, candle.low], (h, l) => (h + l) / 2);
const hh = ta.highest(hl2, length), ll = ta.lowest(hl2, length);
const value = ta.recur([hl2, hh, ll], { v: NaN }, (s, m, h, l) => {
  const raw = 0.66 * ((m - l) / (h - l) - 0.5) + 0.67 * (s.v === s.v ? s.v : 0);
  s.v = Number.isFinite(raw) ? math.max(-0.999, math.min(0.999, raw)) : NaN;
  return s.v;
});
const fish = ta.recur([value], { f: NaN }, (s, v) => (s.f = 0.5 * math.log((1 + v) / (1 - v)) + 0.5 * (s.f === s.f ? s.f : 0)));
plot(fish, { title: "Fisher", color: input.color("Fisher color", "#2962FF", { group: "Style" }) });
plot(ta.calc([fish], () => fish.at(1)), { title: "Trigger", color: input.color("Trigger color", "#FF6D00", { group: "Style" }) });
hline(1.5, { title: "1.5", color: "#E91E63", style: "dashed" });
hline(0.75, { title: "0.75", color: "#787B86", style: "dashed" });
hline(0, { title: "0", color: "#E91E63", style: "dashed" });
hline(-0.75, { title: "-0.75", color: "#787B86", style: "dashed" });
hline(-1.5, { title: "-1.5", color: "#E91E63", style: "dashed" });

AlphaScript language v0.1 · runtime 0.2.0