Table of Contents

Class CompositeIndicator

Namespace
FinanceSharp.Indicators
Assembly
FinanceSharp.dll

This indicator is capable of wiring up two separate indicators into a single indicator such that the output of each will be sent to a user specified function.

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

Remarks

This type is initialized such that there is no need to call the Update function. This indicator will have its values automatically updated each time a new piece of data is received from both the left and right indicators.

Constructors

CompositeIndicator(IIndicator, IIndicator, IndicatorComposer, CompositionMethod)

Creates a new CompositeIndicator capable of taking the output from the left and right indicators and producing a new value via the composer delegate specified

public CompositeIndicator(IIndicator left, IIndicator right, CompositeIndicator.IndicatorComposer composer, CompositionMethod method = CompositionMethod.OnBothUpdated)

Parameters

left IIndicator

The left indicator for the 'composer'

right IIndicator

The right indidcator for the 'composoer'

composer CompositeIndicator.IndicatorComposer

Function used to compose the left and right indicators

method CompositionMethod

What method to composite the two indicators.

CompositeIndicator(IUpdatable, IUpdatable, IndicatorComposer, CompositionMethod)

Creates a new CompositeIndicator capable of taking the output from the left and right indicators and producing a new value via the composer delegate specified

public CompositeIndicator(IUpdatable left, IUpdatable right, CompositeIndicator.IndicatorComposer composer, CompositionMethod method = CompositionMethod.OnBothUpdated)

Parameters

left IUpdatable

The left indicator for the 'composer'

right IUpdatable

The right indidcator for the 'composoer'

composer CompositeIndicator.IndicatorComposer

Function used to compose the left and right indicators

method CompositionMethod

What method to composite the two indicators.

CompositeIndicator(string, IUpdatable, IUpdatable, IndicatorComposer, CompositionMethod)

Creates a new CompositeIndicator capable of taking the output from the left and right indicators and producing a new value via the composer delegate specified

public CompositeIndicator(string name, IUpdatable left, IUpdatable right, CompositeIndicator.IndicatorComposer composer, CompositionMethod method = CompositionMethod.OnBothUpdated)

Parameters

name string

The name of this indicator

left IUpdatable

The left indicator for the 'composer'

right IUpdatable

The right indidcator for the 'composoer'

composer CompositeIndicator.IndicatorComposer

Function used to compose the left and right indicators

method CompositionMethod

What method to composite the two indicators.

Properties

IsReady

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

public override bool IsReady { get; }

Property Value

bool

Left

Gets the 'left' indicator for the delegate

public IUpdatable Left { get; }

Property Value

IUpdatable

OutputCount

The number of items Current will have.

public override int OutputCount { get; protected set; }

Property Value

int

Properties

The number of properties Current will have.

public override int Properties { get; }

Property Value

int

Right

Gets the 'right' indicator for the delegate

public IUpdatable Right { get; }

Property Value

IUpdatable

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

Remarks

Since this class overrides ValidateAndForward, this method is a no-op

Reset()

Resets this indicator to its initial state

public override void Reset()

Update(long, DoubleArray)

Updates the state of this indicator with the given value and returns true if this indicator is ready, false otherwise

public override void Update(long time, DoubleArray input)

Parameters

time long
input DoubleArray

The value to use to update this indicator