Adds two series together.

Namespace: RightEdge.Indicators
Assembly: Indicators (in Indicators.dll) Version: 2010.1.0.0 (2010.1.0.0)

Syntax

C#
[SerializableAttribute]
public class AddSeries : SeriesCalculatorBaseSimple
Visual Basic
<SerializableAttribute>
Public Class AddSeries
	Inherits SeriesCalculatorBaseSimple
Visual C++
[SerializableAttribute]
public ref class AddSeries : public SeriesCalculatorBaseSimple
F#
[<SerializableAttribute>]
type AddSeries =  
    class
        inherit SeriesCalculatorBaseSimple
    end

Remarks

While not really an indicator per se, this is a utility class that will take two series or a series and a constant and add them together to produce a resulting series.

Examples

The following code example demonstrates how to use the add, subtract, divide and multiply utility series in a trading system.
C# Copy imageCopy
public class MySymbolScript
{
    // Declare the indicators
    public AddSeries sumSeries;
    public SubtractSeries subSeries;
    public DivideSeries divSeries;
    public MultiplySeries multSeries;

    public void Startup()
    {
        // Instantiate instances of the add, subtract, divide,
        // and multiply series
        sumSeries = new AddSeries();
           subSeries = new SubtractSeries();
           multSeries = new MultiplySeries();
           divSeries = new DivideSeries();

        // Sum the high and low prices
        sumSeries.SetInputs(High, Low);
        // Draw the sum series in blue
        sumSeries.ChartSettings.Color = Color.Blue;

        // Subtract high from low in this series
        subSeries.SetInputs(High, Low);
        // Draw the subtract series in red
        subSeries.ChartSettings.Color = Color.Red;

        // Multiply high times the low in this series
        multSeries.SetInputs(High, Low);
        // Draw the multiply series in green
        multSeries.ChartSettings.Color = Color.Green;

        // Divide the high price by the low price in this series
        divSeries.SetInputs(High, Low);
        // Draw the divide series in yellow
        divSeries.ChartSettings.Color = Color.Yellow;
    }

    public void NewBar()
    {
        // Put your trading code here

        // These lines demonstrate how to access the current value of the indicators.
        double addVal = sumSeries.Current;
        double subVal = subSeries.Current;
        double multVal = multSeries.Current;
        double divVal = divSeries.Current;
    }
}
Visual Basic.Net Copy imageCopy
Public Class MySymbolScript 
    ' Declare the indicators 
    Public sumSeries As AddSeries 
    Public subSeries As SubtractSeries 
    Public divSeries As DivideSeries 
    Public multSeries As MultiplySeries 

    Public Sub Startup() 
        ' Instantiate instances of the add, subtract, divide, 
        ' and multiply series 
        sumSeries = New AddSeries() 
        subSeries = New SubtractSeries() 
        multSeries = New MultiplySeries() 
        divSeries = New DivideSeries() 

        ' Sum the high and low prices 
        sumSeries.SetInputs(High, Low) 
        ' Draw the sum series in blue 
        sumSeries.ChartSettings.Color = Color.Blue 

        ' Subtract high from low in this series 
        subSeries.SetInputs(High, Low) 
        ' Draw the subtract series in red 
        subSeries.ChartSettings.Color = Color.Red 

        ' Multiply high times the low in this series 
        multSeries.SetInputs(High, Low) 
        ' Draw the multiply series in green 
        multSeries.ChartSettings.Color = Color.Green 

        ' Divide the high price by the low price in this series 
        divSeries.SetInputs(High, Low) 
        ' Draw the divide series in yellow 
        divSeries.ChartSettings.Color = Color.Yellow 
    End Sub 

    Public Sub NewBar() 
        ' Put your trading code here 

        ' These lines demonstrate how to access the current value of the indicators. 
        Dim addVal As Double = sumSeries.Current 
        Dim subVal As Double = subSeries.Current 
        Dim multVal As Double = multSeries.Current 
        Dim divVal As Double = divSeries.Current 
    End Sub 
End Class

Inheritance Hierarchy

See Also