Description
This is a very fast crossover trade trigger indicator and if used in conjunction with a good trend-following tool it is predictive and can be applied in strategies (coming soon). When compared to MACD or other crossover indicators the Fisher Transform is clearly superior and timely.
![qualitiedx2's avatar](/uploads/user-11/avatar/54f691b1f5974a3137fbf57ac1a7a6cd77e46855.jpeg)
qualitiedx2
Joined on 30.09.2011
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: FisherTransform.algo
- Rating: 5
- Installs: 8900
Comments
![cwik_m's avatar](/uploads/user-18875/avatar/c8ba27bf2b735a16e0ab00a6d3b6841c22ffe615.jpeg)
Most of your indicators are great! and really useful
Unfortunatelly, this one doesn't show anything once loaded onto the chart
Moreover, the variable from line 22 (int tr = 0;) is not used anywhere..
Could you, by any chance, look into this code again, please?
![aimerdoux's avatar](/uploads/user-6459/avatar/59190ed6020481eb789fa84c12ef0fc5285e796a.png)
Sorry I might be wrong but can you explain me why do you calculate the fisher transform without calculating the Correlation coefficient ? thank you
Here is the code optimized, and with a fix. the 0.9999 check should be after assigning a value to Value1, thats why some periods appear are blank.
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
namespace cAlgo.Indicators
{
[Indicator(IsOverlay = false, AccessRights = AccessRights.None)]
public class FisherTransform : Indicator
{
[Output("FisherTransform", LineColor = "Orange")]
public IndicatorDataSeries Fish { get; set; }
[Output("Trigger", LineColor = "Green")]
public IndicatorDataSeries trigger { get; set; }
[Parameter(DefaultValue = 13, MinValue = 2)]
public int Len { get; set; }
double MaxH;
double MinL;
private IndicatorDataSeries Value1;
protected override void Initialize()
{
Value1 = CreateDataSeries();
}
public override void Calculate(int index)
{
if (index <= Len + 1)
{
Value1[index - 1] = 1;
Fish[index - 1] = 0;
}
MaxH = MarketSeries.Median.Maximum(Len);
MinL = MarketSeries.Median.Minimum(Len);
Value1[index] = 0.5 * 2 * ((MarketSeries.Median[index] - MinL) / (MaxH - MinL) - 0.5) + 0.5 * Value1[index - 1];
if (Value1[index] > 0.9999)
Value1[index] = 0.9999;
else if (Value1[index] < -0.9999)
Value1[index] = -0.9999;
Fish[index] = 0.25 * Math.Log((1 + Value1[index]) / (1 - Value1[index])) + 0.5 * Fish[index - 1];
trigger[index] = Fish[index - 1];
}
}
}