Logical operators combine Boolean sequences element-by-element. They are typically used after comparison or pattern-matching operations.
In the C# API, analytics operate on
Sequencevalues obtained fromOrderedSequence<T>searches, direct ordered-sequence iteration,UnorderedSequence<T>.All, or positional projections such asquote.Close[dayRange].For an overview see page The C# Sequence Class
Operations
left & rightBoolean AND.left | rightBoolean OR.left ^ rightBoolean exclusive OR.Example
This example keeps only the days where both conditions are true: the price closed higher than it opened and the volume exceeded the chosen threshold.
using (Sequence dayRange = quote.Day.Search(20130101u, SelectBoundary.Inclusive, 20130401u, SelectBoundary.Inclusive)) using (Sequence busyUpDays = (quote.Close[dayRange] > quote.Open[dayRange]) & (quote.Volume[dayRange] > Sequence.Constant(con, 1000u))) { PrintIntSequence(quote, dayRange.Filter(busyUpDays)); }