Supported Indicators

Fisher Transform

Introduction

The Fisher transform is a mathematical process which is used to convert any data set to a modified data set whose Probability Distribution Function is approximately Gaussian. Once the Fisher transform is computed, the transformed data can then be analyzed in terms of it's deviation from the mean. The equation is y = .5 * ln [ 1 + x / 1 - x ] where x is the input y is the output ln is the natural logarithm The Fisher transform has much sharper turning points than other indicators such as MACD For more info, read chapter 1 of Cybernetic Analysis for Stocks and Futures by John F. Ehlers We are implementing the latest version of this indicator found at Fig. 4 of http://www.mesasoftware.com/papers/UsingTheFisherTransform.pdf

Create Manual Indicators

You can manually create a FisherTransform indicator, so it doesn’t automatically update. Manual indicators let you update their values with any data you choose. The following reference table describes the FisherTransform constructor.

FisherTransform()1/2

            FisherTransform QuantConnect.Indicators.FisherTransform (
     int  period
   )
        

Initializes a new instance of the FisherTransform class with the default name and period.

FisherTransform()2/2

            FisherTransform QuantConnect.Indicators.FisherTransform (
     string  name,
     int     period
   )
        

A Fisher Transform of Prices.

Update Manual Indicators

You can update the indicator automatically or manually.

Automatic Update

To register a manual indicator for automatic updates with the security data, call the RegisterIndicator method.


private FisherTransform _fish;

// In Initialize()
_fish = new FisherTransform(name, period);
_fish.Updated += IndicatorUpdateMethod;

RegisterIndicator(symbol, _fish, Resolution.Daily);

// In IndicatorUpdateMethod()
if (_fish.IsReady)
{
    var indicatorValue = _fish.Current.Value;
}
    
# In Initialize()
self.fish = FisherTransform(name, period)
self.fish.Updated += self.IndicatorUpdateMethod

self.RegisterIndicator(symbol, self.fish, Resolution.Daily)

# In IndicatorUpdateMethod()
if self.fish.IsReady:
    indicator_value = self.fish.Current.Value

To customize the data that automatically updates the indicator, see Custom Indicator Periods and Custom Indicator Values.

Manual Update

Updating your indicator manually enables you to control when the indicator is updated and what data you use to update it. To manually update the indicator, call the Update method with a TradeBar, QuoteBar, or an IndicatorDataPoint. The indicator will only be ready after you prime it with enough data.

    
private FisherTransform _fish;
private Symbol symbol;

// In Initialize()
_fish = new FisherTransform(period);
symbol = AddEquity("SPY").Symbol;

// In OnData()
if (data.QuoteBars.ContainsKey(_symbol))
{
    _fish.Update(data.QuoteBars[symbol]);
}
if (_fish.IsReady)
{
    var indicatorValue = _fish.Current.Value;
}
    
# In Initialize()
self.fish = FisherTransform(period)
self.symbol = self.AddEquity("SPY").Symbol

# In OnData()
if data.QuoteBars.ContainsKey(self.symbol):
    self.fish.Update(data.QuoteBars[self.symbol])
if self.fish.IsReady:
    indicator_value = self.fish.Current.Value

Create Automatic Indicators

The FISH method creates an FisherTransform indicator, sets up a consolidator to update the indicator, and then returns the indicator so you can use it in your algorithm.

The following reference table describes the FISH method:

FISH()1/1

            FisherTransform QuantConnect.Algorithm.QCAlgorithm.FISH (
    Symbol                                symbol,
    Int32                                 period,
    *Nullable<Resolution>           resolution,
    *Func<IBaseData, IBaseDataBar>  selector
   )
        

Creates an FisherTransform indicator for the symbol. The indicator will be automatically updated on the given resolution.


If you don't provide a resolution, it defaults to the security resolution. If you provide a resolution, it must be greater than or equal to the resolution of the security. For instance, if you subscribe to hourly data for a security, you should update its indicator with data that spans 1 hour or longer.

For more information about the selector argument, see Alternative Price Fields.

Get Indicator Values

To get the value of the indicator, use its Current.Value attribute.

private FisherTransform _fish;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_fish = FISH(symbol, period);

// In OnData()
if (_fish.IsReady)
{
    var current = _fish.Current.Value;
}
# In Initialize()
symbol = self.AddEquity("SPY").Symbol
self.fish = self.FISH(symbol, period)

# In OnData()
if self.fish.IsReady:
    current = self.fish.Current.Value

Visualization

To plot indicator values, in the OnData event handler, call the Plot method.

private FisherTransform _fish;

// In Initialize()
var symbol = AddEquity("SPY").Symbol;
_fish = FISH(symbol, period);

// In OnData()
if (_fish.IsReady)
{
    Plot("My Indicators", "fishertransform", _fish.Current);
}
# In Initialize()
symbol = self.AddEquity("SPY").Symbol
self.fish = self.FISH(symbol, period)

# In OnData()
if self.fish.IsReady:
    self.Plot("My Indicators", "fishertransform", self.fish.Current)

The following image shows the plot values in a matplotlib plot. To load algorithm plot data into the Research Environment, see Charts.

For more information about plotting indicators, see Plotting Indicators.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: