Unary Sequence Operations in C#

Unary operators and helper methods transform one input sequence into another 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

-source
Negates numeric sequence values.
!source
Inverts a Boolean sequence.
source.Abs()
Returns absolute values.
source.Match(string pattern)
Returns a Boolean sequence indicating which string elements match the pattern.

Example

This example calculates the absolute difference between close and open prices.

    using (Sequence delta = quote.Close.All - quote.Open.All)
    using (Sequence absDelta = delta.Abs())
    {
        PrintFloatSequence(quote, absDelta);
    }