Table of Contents

Class FunctionalIndicator

Namespace
FinanceSharp.Indicators
Assembly
FinanceSharp.dll

The functional indicator is used to lift any function into an indicator. This can be very useful when trying to combine output of several indicators, or for expression a mathematical equation

public class FunctionalIndicator : IndicatorBase, IIndicator, IUpdatable
Inheritance
FunctionalIndicator
Implements
Inherited Members
Extension Methods

Constructors

FunctionalIndicator(string, Func<long, DoubleArray, DoubleArray>, Func<IndicatorBase, bool>, Action)

Creates a new FunctionalIndicator using the specified functions as its implementation.

public FunctionalIndicator(string name, Func<long, DoubleArray, DoubleArray> computeNextValue, Func<IndicatorBase, bool> isReady = null, Action reset = null)

Parameters

name string

The name of this indicator

computeNextValue Func<long, DoubleArray, DoubleArray>

A function accepting the input value and returning this indicator's output value

isReady Func<IndicatorBase, bool>

A function accepting this indicator and returning true if the indicator is ready, false otherwise

reset Action

Function called to reset this indicator and any indicators this is dependent on

Properties

IsReady

Gets a flag indicating when this indicator is ready and fully initialized

public override bool IsReady { get; }

Property Value

bool

Methods

Forward(long, DoubleArray)

Computes the next value of this indicator from the given state

protected override DoubleArray Forward(long time, DoubleArray input)

Parameters

time long
input DoubleArray

The input given to the indicator

Returns

DoubleArray

A new value for this indicator

Reset()

Resets this indicator to its initial state, optionally using the reset action passed via the constructor

public override void Reset()