FloatSeries

Description

Float series is a DataSeries that contains a float value for each bar in the chart. The number of elements in this series corresponds to the number of bars within the chart.

Create a New Data Series

Create a new variable in the declaration area:

//Variable declaration
private FloatSeries myDataSeries;

Assign a new instance of the FloatSeries to the variable with the OnInit() method:

protected override void OnInit()
{
myDatatSeries = new FloatSeries(this);
CalculateOnClosedBar = true;
}

Assign Values

Assigning a value to the current position of the data series

myDataSeries.Set(float Value);

Writing a value from the past into the data series:

myDataSeries.Set(int barsAgo, float Value);

Delete Values

Removing the current value from the data series:

myDataSeries.Reset();

Removing a value located in the past from the data series:

myDataSeries.Reset(int barsAgo);

Check Values for their Validity

myDataSeries.ContainsValue(int barsAgo);

Read Value

Print ("For the bar from " + Time[0] + " ago the value for the data series is: " + myDataSeries[0]);

Example

//Saves the span between the high and the low of a bar
myDataSeries.Set(Math.Abs((float) High[0] - (float) Low[0]));

Last updated