Binary Sequence Operations in C#

Use these operations when you need to combine two compatible sequences element-by-element and produce a new result sequence.

In the C# API, analytics operate on Sequence values obtained from OrderedSequence<T> searches, direct ordered-sequence iteration, UnorderedSequence<T>.All, or positional projections such as quote.Close[dayRange].

For an overview see page The C# Sequence Class

Operations

left + right
Adds corresponding elements from two sequences.
left - right
Subtracts the right-hand sequence from the left-hand sequence.
left * right
Multiplies corresponding elements.
left / right
Divides corresponding elements.
left % right
Applies modulo element-by-element.
Sequence.Max(left, right)
Returns the greater value from each element pair.
Sequence.Min(left, right)
Returns the smaller value from each element pair.

Example

This example computes the daily spread between the high and low prices for each quote.

    using (Sequence spread = quote.High.All - quote.Low.All)
    {
        PrintFloatSequence(quote, spread);
    }