41 private const double _alpha = .33;
42 private double _previous;
43 private readonly
Minimum _medianMin;
44 private readonly
Maximum _medianMax;
51 : this($
"FISH({period})", period)
64 _medianMax =
new Maximum(
"MedianMax", period);
65 _medianMin =
new Minimum(
"MedianMin", period);
72 public override bool IsReady => _medianMax.IsReady && _medianMax.IsReady;
91 var price = (input.
Low + input.
High) / 2m;
92 _medianMin.Update(input.
Time, price);
93 _medianMax.Update(input.
Time, price);
99 var minL = _medianMin.Current.Value;
100 var maxH = _medianMax.Current.Value;
104 x = _alpha * 2 * ((double)((price - minL) / (maxH - minL)) - .5) + (1 - _alpha) * _previous;
105 y = FisherTransformFunction(x);
109 return Convert.ToDecimal(y) + .5m * Current.Value;
139 private double FisherTransformFunction(
double x)
150 return .5 * Math.Log((1.0 + x) / (1.0 - x));