Values

Description

Values are a collection that contains the data series objects of an indicator.

When a plot is added to an indicator using the Add() method, a value object is automatically created and added to the "values" collection.

The order of the add commands determines how the values are sorted. The first information request will create Values[0], the next information request will create Values[1], etc.

Value is always identical to Values[0].

Usage

Outputs[int index]
Outputs[int index][int barsAgo]

More Information

The methods known for a collection, Set() Reset() and Count(), are applicable for values.

Information on the class collection: Class Collection

Example

// Check the second indicator value of one bar ago and set the value of the current indicator value based on it.
if (Instrument.Compare(Outputs[1][1], High[0] - Low[0]) < 0)
    Value.Set(High[0] - Low[0]);
else
    Value.Set(High[0] - Close[0]);

Last updated