Keywords

AddOutput()

AddLine()

Description

The add method allows you to add plots or line objects to the chart. When a new plot object is added using Add(), this automatically creates a data series of the type DataSeries, which is attached to this object. The value collection allows you to reference and access this data series. Add() can be used with the OnInit() and the OnCalculate() methods.

Parameter

plot – a OutputDescriptor object line – a LevelLine object

Usage

AddOutput(new OutputDescriptor(Color.FromKnownColor(KnownColor.Black), "MyPlot1"));
Add(LevelLine line)

Example

#region Usings
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Xml;
using System.Xml.Serialization;
using AgenaTrader.API;
using AgenaTrader.Custom;
using AgenaTrader.Plugins;
using AgenaTrader.Helper;
#endregion
namespace AgenaTrader.UserCode
{
[Description("Enter the description for the new custom indicator here")]
public class MyIndicator : UserIndicator
{
protected override void OnInit()
{
// Two blue lines will be placed into the chart, one at 70 and the other at 30
AddLine(new LevelLine(Color.Blue, 70, "UpperLine"));
AddLine(new LevelLine(Color.Blue, 30, "LowerLine"));
​
// Add 2 plots
AddOutput(new OutputDescriptor(Color.FromKnownColor(KnownColor.Red), "FastSMA"));
AddOutput(new OutputDescriptor(Color.FromKnownColor(KnownColor.Blue), "SlowSMA"));
}
​
protected override void OnCalculate()
{
//The set method is assigned to the value of the current bar
FastSMA.Set( SMA(8)[0] ); // is identical with Outputs[0].Set( SMA(8)[0] );
SlowSMA.Set( SMA(50)[0] ); // is identical with Outputs[1].Set( SMA(50)[0] );
}
​
// Two data series are made available here
// These are not necessary for the display of the indicator // With the help of these series, one indicator can access the other
// For example: double d = MyIndicator.FastSMA[0] - MyIndicator.SlowSMA[0];
[Browsable(false)]
[XmlIgnore()]
public DataSeries FastSMA
{
get { return Outputs[0]; }
}
​
[Browsable(false)]
[XmlIgnore()]
public DataSeries SlowSMA
{
get { return Outputs[1]; }
}
}
}

AllowRemovalOfChartDrawings

Description

"AllowRemovalOfChartDrawings" is a property of indicators that can be set under OnInit().
AllowRemovalOfChartDrawings = true
Drawing objects that are drawn by an indicator or a strategy can be manually removed from the chart.
AllowRemovalOfChartDrawings = false (default)
Drawing objects that have been created by a strategy or indicator CANNOT be manually removed from the chart. They are removed once the indicator or strategy is removed.
This property can be queried and will return "true" or "false".

Usage

AllowRemovalOfChartDrawings

Example

protected override void OnInit()
{
AddOutput(new OutputDescriptor(Color.FromKnownColor(KnownColor.Black), "MyPlot1"));
//Drawing objects can be manually removed from the chart
AllowRemovalOfChartDrawings = true;
}

Attribute

Attribute is a component of the C# language. Within AgenaScript, indicators, and strategies, you can use these attributes in the same manner as you would in C#. Information regarding the usage of attributes can be found here:
The most commonly used attributes in AgenaScript are:

Browsable

Browsable is an Attribute within AgenaScript.
AgenaScript uses public variables for entering parameters for indicators (such as periods for the SMA) and for outputting events and calculations within indicators (for example, data series). Variables used for entering parameters must be displayed in the properties dialog. Data series are exempt from this. Public variables with the browsable attribute set to false are not displayed within the properties dialog.
By default, browsable is set to true. Therefore, within a variable containing an entry parameter, the attribute does not need to be specified.
Example for a parameter:
The parameter should be displayed and queried in the properties window. Therefore browsable should be set to true.
[Description("Numbers of bars used for calculations")]
[Category("InputParameter")]
public int Period
{
get { return period; }
set { period = Math.Max(1, value); }
}
Example for a data series:
[Browsable(false)]
[DisplayName("Lower band")]
[XmlIgnore]
public DataSeries Lower
{
get { return Outputs[0]; }
}

Category

Category is an Attribute in AgenaScript and can be used on properties and classes.
The category attribute on properties defines under which category in the properties dialog the parameter is shown. If this attribute is missing, the parameters category is accepted as the standard.
The following example shows how to create the new category "My InputParameter" in the properties dialog:
[Category("My InputParameter")]
[DisplayName("Period number")]
public double _period
{
get { return _period; }
set { _period = value; }
}
Category
If you use the category Attribute on classes you are able to create subcategories for your scripts and group them all in one category. This is pretty useful if you are creating a package and you want to group a few indicators in a group with one name.
The following example shows how to create a subfolder "My Package":
namespace AgenaTrader.UserCode
{
[Description("Description what this indicator doing.")]
[Category("My Package")]
public class MyHolyGrail_Indicator : UserIndicator
{
/* your code here */
}
}

ConditionalValue

Conditional value is an Attribute in AgenaScript.
Normally, when making comparisons within the ConditionEscort, the data series generated by indicators are used. One such example would be checking whether a moving average lies above or below a specific price value. An indicator can also yield values that are not contained within data series, such as values of the type int, double, char, Boolean, string, etc. To use these values within the scanner or ConditionEscort, they have to be labeled with the conditional value attribute.
[Browsable(false)]
[XmlIgnore]
[ConditionalValue]
public int PublicVariable
{
get
{
Update();
return _internVariable;
}
}

Description

Description is an Attribute in AgenaScript.
The description attribute is used in AgenaScript for classes and public variables. As an attribute of the class, the text is a description of the function of the entire indicator.
[Description("Displays the tick count of a bar.")]
public class TickCounter : UserIndicator
{
//As an attribute of a public variable, the text is a description of the function of the parameter.
[Description("Number of standard deviations")]
[DisplayName("# of std. dev.")]
public double NumStdDev
{
get { return numStdDev; }
set { numStdDev = Math.Max(0, value); }
}
}
The descriptions are displayed in the relevant properties dialog.

DisplayName

Display name is an Attribute in AgenaScript.
The display name attribute defines the text shown in the properties dialog for the parameter.
If this attribute is not specified, the name of the public variable is used.
[Description("Number of standard deviations")]
[DisplayName("# of std. dev.")]
public double NumStdDev
{
get { return numStdDev; }
set { numStdDev = Math.Max(0, value); }
}

TimeFrameRequirements

Timeframe requirements is an Attribute in AgenaScripts.
If you want a script to use data from various timeframes, the class requires the attribute β€žTimeFrameRequirements". You can specify multiple timeframes here:
[TimeFrameRequirements("1 day")]
[TimeFrameRequirements("15 minutes", "1 day", "1 week")]
The amount of data provided for the other timeframes will always be the same as the number of actual candles loaded into the chart. If there are 500 candles for a 5-minute chart, then 500 candles of another timeframe will also be loaded. In the first example above, 500 daily candles will be loaded. In the second example, 500 15-minute candles, 500 daily candles and 500 weekly candles will be loaded. The amount of data can become rather large very quickly, thus you should take precautions when using this attribute.
See MultiBars.​
Important:
If a class uses a different indicator that requires one or more secondary timeframes, then the "TimeFrameRequirements" attribute must be set for the class retrieving the data. An example for this can be seen here: GetDayBar.

XMLIgnore

XML ignore is an Attribute in AgenaScript.
AgenaTrader saves all parameter settings for the indicators in a template. The template files are saved in an XML format. In order to avoid a parameter being saved as part of the template, the attribute XML ignore can be set.
To save parameters in an XML file, the values must be serialized. Under most circumstances, AgenaTrader performs this automatically. Self-defined data types cannot be serialized automatically, so in this case the programmer is responsible for the correct serialization. In the following example, the color and font are used as parameters of an indicator. AgenaTrader has two methods for serializing color and font information (TextColorSerialize and TextFontSerialize). Both parameters – TextColor and TextFont – thus need to be marked with the XML ignore parameter.
private Color _textColor = Color.Blue;
private Font _textFont = new Font("Arial", 12, FontStyle.Bold);
[XmlIgnore]
[Description("Textcolor")]
public Color TextColor
{
get { return _textColor; }
set { _textColor = value; }
}
[Browsable(false)]
public string TextColorSerialize
{
get { return SerializableColor.ToString(_textColor); }
set { _textColor = SerializableColor.FromString(value); }
}
[XmlIgnore()]
[Description("TextFont")]
public Font TextFont
{
get { return _textFont; }
set { _textFont = value; }
}
[Browsable(false)]
public string TextFontSerialize
{
get { return SerializableFont.ToString(_textFont); }
set { _textFont = SerializableFont.FromString(value); }
}

CalculateOnClosedBar

Description

The property "CalculateOnClosedBar" determines the events for which AgenaTrader can call up the OnCalculate() method.
CalculateOnClosedBar = true
OnCalculate() is called up when a bar is closed and the next incoming tick creates a new bar.
CalculateOnClosedBar = false
OnCalculate() is called up for each new incoming tick. If you are running AgenaTrader on older hardware, this may cause performance issues with instruments that are highly liquid. The property can be queried in the script and will return a value of the type Boolean (true or false). CalculateOnClosedBar can be used within OnInit() and also within OnCalculate(). OnCalculate is only called up for the closing price of each bar with historical data, even if CalculateOnClosedBar is set to false. When an indicator is called up by another indicator, the CalculateOnClosedBar property of the retrieved indicator overwrites the indicator performing the retrieving.

Usage

CalculateOnClosedBar

More Information

See Bars.​

Example

protected override void OnInit()
{
//Indicator calculation should only occur when a bar has closed/finished
CalculateOnClosedBar = true;
}

Chart

Chart control is an object that provides reading access of various properties for the chart.
The important properties are:
  • ChartFontColor, BackColor
  • UpColor, DownColor
  • Font
  • BarMarginLeft, BarMarginRight
  • BarSpace, BarWidth
  • BarsPainted
  • FirstBarPainted, LastBarPainted
  • BarsVisible
  • FirstBarVisible, LastBarVisible
  • GetXByBarIdx, GetYByValue
An example can be seen here: PlotMethod.
BarsPainted und BarsVisible:
BarsPainted contains the number of bars that a chart could display from the left to right border with the current width and distance of the candles. BarsVisible contains the number of bars actually visible.
FirstBarPainted und FirstBarVisible:
FirstBarPainted contains the number of the bar that would be displayed on the left border of the chart.
FirstBarVisible contains the number of the bar that is actually shown as the first bar on the left side of the chart area.
Example: the chart has been moved so that the first bar of the chart is now in the middle of the chart.
FirstBarPainted would be negative.
FirstBarVisible would be 0.
LastBarPainted und LastBarVisible:
LastBarPainted contains the number of the bar that would be displayed on the right border of the chart.
LastBarVisible contains the number of the bar that is actually displayed on the right side of the chart.
Example: the chart has been moved so that the last bar of the chart is displayed in the middle section.
LastBarPainted would be larger than Bars.Count.
LastBarVisible would be Bars.Count -1.

ClearTraceWindow()

Description

The ClearTraceWindow() method empties the output window. The method can be used within OnInit() as well as within OnCalculate(). The output window contains all outputs that have been created with the Print() command. Using the output window is a great method for code debugging.

Usage

ClearTraceWindow()

Parameter

none

Return Value

none

Example

protected override void OnInit()
{
// Delete the content of the output window
ClearTraceWindow();
}

Colors

AgenaScript provides you with the following commands for defining colors and making color changes to the chart:
​BarColor Color of a bar
​BackColor Background color of the chart
​BackColorAll Background color of the chart and all panels
Chart.UpColor Color of up ticks (up bars) Chart.DownColor Color of down ticks (down bars)
For each bar, its colors are saved in the following data series. If these data series are written in, the color of the referenced bar will change.
​BarColorSeries​
​BackColorSeries​
​BackColorAllSeries​

BackColor

Description

Back color changes the background color of a bar or gives the current background color of a bar when queried.

Parameter

A color object of the type "public struct color"

Usage

BackColor

Example

// Every Monday, change the bar background color to blue
if (Time[0].DayOfWeek == DayOfWeek.Monday)
BackColor = Color.Blue;
BackColor
// Changing the bar background color depending on a smoothing average
// Market price above the SMA(14) to green
// Market price below the SMA(14) to maroon
BackColor = SMA(14)[0] >= Close[0] ? Color.Maroon : Color.LimeGreen;
BackColor

BackColorAll

Description

Back color all changes the background color of a bar within the chart window and in all subcharts.

Parameter

A color object of the type "public struct color"

Usage

BackColorAll

Example

// Every Monday, change the bar background color to blue
if (Time[0].DayOfWeek == DayOfWeek.Monday)
BackColorAll = Color.Blue;
BackColorAll

BackColorAllSeries

Description

Back color all series is a data series containing the background color for each bar. The difference to BackColorSeries is that the background color of the subchart is included.

Parameter

a color object of the type "public struct color"
int barsAgo

Usage

BackColorAllSeries
BackColorAllSeries[int barsAgo]
When using the method with an index [int barsAgo] the background color for the referenced bar will be changed or returned.

Example

BackColorSeries

Description

Back color series is a data series containing the background color for each bar. If the background color for the subcharts is to be included, please use "BackColorAllSeries" instead.

Parameter

a color object of the type "public struct color"
int barsAgo

Usage

BackColorSeries
BackColorSeries[int barsAgo]
When using this method with an index [int barsAgo] the background color for the referenced bar will be outputted.

Example

// Which background color does the current bar have?
Print (BackColorSeries[0]);
// Set the current bar’s background color to blue
// This is identical to BackColor = Color.Blue
BackColorSeries[3] = Color.Blue;
// Set background color for the previous bar to green
BackColorSeries[1] = Color.Green;

BarColor

Description

Bar color changes the color of a bar.

Parameter

a color object of the type "public struct color"

Usage

BarColor

Example

// If the closing price is above the SMA(14), color the bar orange
if (Close[0] > SMA(14)[0]) BarColor = Color.Orange;
BarColor

BarColorSeries

Description

Bar color series is a data series containing the color for each bar.

Parameter

a color object of the type "public struct color"
int barsAgo

Usage

BarColorSeries
BarColorSeries[int barsAgo]
When using the method with an index [int barsAgo] the color for the referenced bar will be changed or returned.
Caution: Only the color of a bar whose color has been explicitly changed beforehand will be returned. In all other cases, the "Color.Empty" value will be returned.

Example

protected override void OnCalculate()
{
if (ProcessingBarIndex == Bars.Count-1-(CalculateOnClosedBar?1:0))
{
// Color the current bar blue
// This is identical to BarColor = color.Blue
BarColorSeries[0] = Color.Blue;
// Color the previous bars green
BarColorSeries[1] = Color.Orange;
// Color the third bar yellow
BarColorSeries[2] = Color.Yellow;
}
}
BarColorSeries

CandleOutlineColor

Description

Candle outline color changes the border/outline color (including the wick) of a bar.
If the color of the bar is changed using BarColor and the outline is not changed using CandleOutlineColor, the outline color is adjusted to match the color of the bar.

Parameter

a color object of the type "public struct color"

Usage

CandleOutlineColor

Example

if (SMA(14)[0] > SMA(200)[0])
CandleOutlineColor = Color.LimeGreen;
else
CandleOutlineColor = Color.Red;
CandleOutlineColor

CandleOutlineColorSeries

Description

Candle outline color series is a data series that saves the outline color for each bar.

Parameter

a color object of the type "public struct color"
int barsAgo

Usage

CandleOutlineColorSeries
CandleOutlineColorSeries[int barsAgo]
When using this method with an index [int barsAgo] the border color for the referenced bar will be outputted.
Caution: Color.Empty will be outputted for a bar unless it has been previously changed.

Example

// Set the outline color of the current bar to blue
CandleOutlineColorSeries[0] = Color.Blue;
// Change the outline color to the chart default value
CandleOutlineColorSeries[0] = Color.Empty;

CrossAbove()

Description

The CrossAbove() method allows you to check whether a crossing of two values has occurred (from bottom to top) within a predefined number of periods. The values can be a market price, an indicator, a data series or a constant value.

Usage

CrossAbove(IDataSeries series1, double value, int lookBackPeriod)
CrossAbove(IDataSeries series1, IDataSeries series2, int lookBackPeriod)

Return Value

true a cross has occurred false a cross has not occurred

Parameter

lookBackPeriod
Number of bars within which a cross will be searched for
series1 und series2
A data series such as an indicator, close, high, etc.
value
A constant value of the type double

Example

// Puts out a notice if the SMA(20) crosses above the SMA(50)
if (CrossAbove(SMA(20), SMA(50), 1))
Print("SMA(20) has risen above SMA(50)!");
// Puts out a notice if the SMA(20) crosses above the value of 40
if (CrossAbove(SMA(20), 40, 1))
Print("SMA(20) has risen above 40!");
// Put out a notice for a long entry if the SMA(20) has crossed above the SMA(50) within the last 5 bars.
if (CrossAbove(SMA(20), SMA(50), 1) && Close[0] > Close[1])
Print("Long entry !!!");

CrossBelow()

Description

Using the CrossBelow() method, you can test whether or not a cross below has occurred within a predefined number of periods. The values can be the market price, an indicator, any data series, or a constant value.

Usage

CrossBelow(IDataSeries series1, double value, int lookBackPeriod)
CrossBelow(IDataSeries series1, IDataSeries series2, int lookBackPeriod)

Return Value

true a cross has occurred false a cross has not occurred

Parameter

lookBackPeriod
Number of Bars within which a cross will be searched for
series1 und series2
A data series such as an indicator, close, high etc.
value
A constant value of the type double

Example

// Puts out a notice if the SMA(20) crosses below the SMA(50)
if (CrossBelow(SMA(20), SMA(50), 1))
Print("SMA(20) has fallen below SMA(50)!");
// Puts out a notice if the SMA(20) falls below the value of 40
if (CrossBelow(SMA(20), 40, 1))
Print("SMA(20) has fallen below 40!");
// Puts out a notice for a short entry if a crossing of the SMA(20) below the SMA(50) has occurred within the last 5 bars.
.
if (CrossBelow(SMA(20), SMA(50), 1)
&& Instrument.Compare(Close[1], Close[0]) > 1)
Print("Short entry !!!");

DatafeedHistoryPeriodicity

Description

Datafeed history periodicity is a data type.

Definition

public enum DatafeedHistoryPeriodicity - DatafeedHistoryPeriodicity.Tick - DatafeedHistoryPeriodicity.Second - DatafeedHistoryPeriodicity.Minute - DatafeedHistoryPeriodicity.Hour - DatafeedHistoryPeriodicity.Day - DatafeedHistoryPeriodicity.Week - DatafeedHistoryPeriodicity.Month - DatafeedHistoryPeriodicity.Volume - DatafeedHistoryPeriodicity.Range - DatafeedHistoryPeriodicity.Quarter - DatafeedHistoryPeriodicity.Year - DatafeedHistoryPeriodicity.HeikinAshi - DatafeedHistoryPeriodicity.Renko - DatafeedHistoryPeriodicity.LineBreak - DatafeedHistoryPeriodicity.Kagi - DatafeedHistoryPeriodicity.PointAndFigure - DatafeedHistoryPeriodicity.Custom
See TimeFrame, TimeFrames.

DataSeries

Description

Data series (data rows) are an easy yet powerful method of saving additional values for individual bars. For example, when calculating the smoothing average, each bar is assigned the value calculated for this bar. A data series is an array that contains as many elements as there are bars displayed in a chart. AgenaTrader ensures that data series are correctly synchronized with the bars. Data series are used in exactly the same way as the close or time series. They can therefore also be used for the input data for various indicators. In the table below you will find 4 newly created data series (highlighted). Each data series has exactly one value of a special data type (int, bool, string) attached to it per bar. The indexing with barsAgo is thus identical to the data series provided by the system.
DataSeries

Usable Data Series in AgenaTrader

​BoolSeries​
​DataSeries​
​DateTimeSeries​
​FloatSeries​
​IntSeries​
​LongSeries​
​StringSeries​
In addition, there are also data series such as ColorSeries, although these are only used for internal purposes and should not be used directly. To change the color of plots, please use PlotColors.

Set(), Reset() und ContainsValue()

Each data series contains a Set(), Reset() and ContainsValue() method. With Set(value) or Set(int barsAgo, value) you can place values into the data series for the current position, or in this case into the barsAgo position. With Reset() or Reset(int barsAgo) you can delete a value from the data series for the current position or for the barsAgo position. This has the result that no valid value exists at this position any more. Programming with the help of the reset method can simplify otherwise complex logic. This is especially true for Boolean series, where only "true" or "false" values can be included. The ContainsValue() checks whether a data series has a value for a specific position.

Information about Data Types

BoolSeries

Description

Bool series is a data series that contains a Boolean value for each bar. The number of elements in this series correlates with the exact number of bars within the chart.

Create New Bool Series

In the area for the declaration of variables, simply declare a new variable:
//Variable declaration
private BoolSeries myBoolSeries;
With the OnInit() method, this variable assigns a new instance of the Bool series:
protected override void OnInit()
{
myBoolSeries = new BoolSeries(this);
CalculateOnClosedBar = true;
}

Assign Values

Assigning a value to the data series for the current position:
myBoolSeries.Set(true);
Writing a value in the past into the data series:
myBoolSeries.Set(int barsAgo, bool Value);

Delete Values

Removing the current value for the data series:
myBoolSeries.Reset();
Removing a value in the past from the data series:
myBoolSeries.Reset(int barsAgo);

Check Values for their Validity

myBoolSeries.ContainsValue(int barsAgo);

Read Value

Print ("For the bar of " + Time[0] + " ago the value of the data series is: " + myBoolSeries[0]);

Example

protected override void OnCalculate()
{
if (Close[0] > Open[0])
myBoolSeries.Set(true);
else
myBoolSeries.Set(false);
}

DataSeries

Description

Data series is a DataSeries that can contain a double value for each bar. The number of elements in this series corresponds to the exact number of bars within the charts.
Data series for double values are the data series most commonly used for indicators.

Create a New Data Series

In the declaration area for variables:
//Variable declaration
private DataSeries myDataSeries;
With the OnInit() method, this variable is assigned a new instance:
protected override void OnInit()
{
myDataSeries = new DataSeries(this);
CalculateOnClosedBar = true;
}

Assign Values

Assigning a value to the data series for the current position:
myDataSeries.Set(Bars[0].Close);
Writing a value in the past into the data series:
myDataSeries.Set(int barsAgo, double Value);

Delete Values

Removing the current value from the data series:
myDataSeries.Reset();
Removing a value 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 low of a bar
myDataSeries.Set(Math.Abs(High[0]-Low[0]));

DateTimeSeries

Description

Date time series is a DataSeries that can record a date time value for each bar. The number of elements in this series corresponds to the number of bars in the chart.

Create a New Data Series

Create a new variable in the declaration area:
//Variable declaration
private DateTimeSeries myDataSeries;
Assign a new instance of DateTimeSeries for the variable with the OnInit() method:
protected override void OnInit()
{
myDataSeries = new DateTimeSeries(this);
CalculateOnClosedBar = true;
}

Assign Values

Assigning a value to the current position of the data series:
myDataSeries.Set(DateTime Value);
Writing a value from the past into the data series:
myDataSeries.Set(int barsAgo, DateTime Value);

Delete Values

Removing the current value from the data series:
myDataSeries.Reset();
Remove a past value 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 of the data series is: " + myDataSeries[0]);

Example

//Saves the difference of -6 hours (eastern time, New York) for a time zone conversion
myDataSeries.Set(Time[0].AddHours(-6));

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