Lean  $LEAN_TAG$
QuantConnect.Algorithm.Framework.Alphas.InsightCollection Class Reference

Provides a collection for managing insights. This type provides collection access semantics as well as dictionary access semantics through TryGetValue, ContainsKey, and this[symbol] More...

Inheritance diagram for QuantConnect.Algorithm.Framework.Alphas.InsightCollection:
[legend]

Public Member Functions

void Add (Insight item)
 Adds an item to the T:System.Collections.Generic.ICollection`1. More...
 
void AddRange (IEnumerable< Insight > insights)
 Adds each item in the specified enumerable of insights to this collection More...
 
bool Contains (Insight item)
 Determines whether the T:System.Collections.Generic.ICollection`1 contains a specific value. More...
 
bool ContainsKey (Symbol symbol)
 Determines whether insights exist in this collection for the specified symbol More...
 
bool Remove (Insight item)
 Removes the first occurrence of a specific object from the T:System.Collections.Generic.ICollection`1. More...
 
bool TryGetValue (Symbol symbol, out List< Insight > insights)
 Attempts to get the list of insights with the specified symbol key More...
 
IEnumerator< InsightGetEnumerator ()
 Returns an enumerator that iterates through the collection. More...
 
void Clear (Symbol[] symbols)
 Removes the symbol and its insights More...
 
DateTime? GetNextExpiryTime ()
 Gets the next expiry time UTC More...
 
ICollection< InsightGetActiveInsights (DateTime utcTime)
 Gets the last generated active insight More...
 
bool HasActiveInsights (Symbol symbol, DateTime utcTime)
 Returns true if there are active insights for a given symbol and time More...
 
ICollection< InsightRemoveExpiredInsights (DateTime utcTime)
 Remove all expired insights from the collection and retuns them More...
 
void RemoveInsights (Func< Insight, bool > filter)
 Will remove insights from the complete insight collection More...
 
List< InsightGetInsights (Func< Insight, bool > filter=null)
 Will return insights from the complete insight collection More...
 
List< InsightGetInsights (PyObject filter)
 Will return insights from the complete insight collection More...
 

Properties

int Count [get]
 The open insight count More...
 
int TotalCount [get]
 The total insight count More...
 
List< Insight >???? this[Symbol symbol] [get, set]
 Dictionary accessor returns a list of insights for the specified symbol More...
 

Detailed Description

Provides a collection for managing insights. This type provides collection access semantics as well as dictionary access semantics through TryGetValue, ContainsKey, and this[symbol]

Definition at line 28 of file InsightCollection.cs.

Member Function Documentation

◆ Add()

void QuantConnect.Algorithm.Framework.Alphas.InsightCollection.Add ( Insight  item)

Adds an item to the T:System.Collections.Generic.ICollection`1.

Parameters
itemThe object to add to the T:System.Collections.Generic.ICollection`1.
Exceptions
T:System.NotSupportedExceptionThe T:System.Collections.Generic.ICollection`1 is read-only.

Definition at line 66 of file InsightCollection.cs.

Here is the caller graph for this function:

◆ AddRange()

void QuantConnect.Algorithm.Framework.Alphas.InsightCollection.AddRange ( IEnumerable< Insight insights)

Adds each item in the specified enumerable of insights to this collection

Parameters
insightsThe insights to add to this collection

Definition at line 87 of file InsightCollection.cs.

Here is the call graph for this function:

◆ Contains()

bool QuantConnect.Algorithm.Framework.Alphas.InsightCollection.Contains ( Insight  item)

Determines whether the T:System.Collections.Generic.ICollection`1 contains a specific value.

Returns
true if item is found in the T:System.Collections.Generic.ICollection`1; otherwise, false.
Parameters
itemThe object to locate in the T:System.Collections.Generic.ICollection`1.

Definition at line 98 of file InsightCollection.cs.

◆ ContainsKey()

bool QuantConnect.Algorithm.Framework.Alphas.InsightCollection.ContainsKey ( Symbol  symbol)

Determines whether insights exist in this collection for the specified symbol

Parameters
symbolThe symbol key
Returns
True if there are insights for the symbol in this collection

Definition at line 112 of file InsightCollection.cs.

◆ Remove()

bool QuantConnect.Algorithm.Framework.Alphas.InsightCollection.Remove ( Insight  item)

Removes the first occurrence of a specific object from the T:System.Collections.Generic.ICollection`1.

Returns
true if item was successfully removed from the T:System.Collections.Generic.ICollection`1; otherwise, false. This method also returns false if item is not found in the original T:System.Collections.Generic.ICollection`1.
Parameters
itemThe object to remove from the T:System.Collections.Generic.ICollection`1.
Exceptions
T:System.NotSupportedExceptionThe T:System.Collections.Generic.ICollection`1 is read-only.

Definition at line 125 of file InsightCollection.cs.

Here is the caller graph for this function:

◆ TryGetValue()

bool QuantConnect.Algorithm.Framework.Alphas.InsightCollection.TryGetValue ( Symbol  symbol,
out List< Insight insights 
)

Attempts to get the list of insights with the specified symbol key

Parameters
symbolThe symbol key
insightsThe insights for the specified symbol, or null if not found
Returns
True if insights for the specified symbol were found, false otherwise

Definition at line 187 of file InsightCollection.cs.

Here is the caller graph for this function:

◆ GetEnumerator()

IEnumerator<Insight> QuantConnect.Algorithm.Framework.Alphas.InsightCollection.GetEnumerator ( )

Returns an enumerator that iterates through the collection.

Returns
A T:System.Collections.Generic.IEnumerator`1 that can be used to iterate through the collection.

<filterpriority>1</filterpriority>

Definition at line 204 of file InsightCollection.cs.

◆ Clear()

void QuantConnect.Algorithm.Framework.Alphas.InsightCollection.Clear ( Symbol[]  symbols)

Removes the symbol and its insights

Parameters
symbolsList of symbols that will be removed

Definition at line 224 of file InsightCollection.cs.

◆ GetNextExpiryTime()

DateTime? QuantConnect.Algorithm.Framework.Alphas.InsightCollection.GetNextExpiryTime ( )

Gets the next expiry time UTC

Definition at line 241 of file InsightCollection.cs.

◆ GetActiveInsights()

ICollection<Insight> QuantConnect.Algorithm.Framework.Alphas.InsightCollection.GetActiveInsights ( DateTime  utcTime)

Gets the last generated active insight

Returns
Collection of insights that are active

Definition at line 259 of file InsightCollection.cs.

◆ HasActiveInsights()

bool QuantConnect.Algorithm.Framework.Alphas.InsightCollection.HasActiveInsights ( Symbol  symbol,
DateTime  utcTime 
)

Returns true if there are active insights for a given symbol and time

Parameters
symbolThe symbol key
utcTimeTime that determines whether the insight has expired
Returns

Definition at line 284 of file InsightCollection.cs.

◆ RemoveExpiredInsights()

ICollection<Insight> QuantConnect.Algorithm.Framework.Alphas.InsightCollection.RemoveExpiredInsights ( DateTime  utcTime)

Remove all expired insights from the collection and retuns them

Parameters
utcTimeTime that determines whether the insight has expired
Returns
Expired insights that were removed

Definition at line 301 of file InsightCollection.cs.

Here is the call graph for this function:

◆ RemoveInsights()

void QuantConnect.Algorithm.Framework.Alphas.InsightCollection.RemoveInsights ( Func< Insight, bool >  filter)

Will remove insights from the complete insight collection

Parameters
filterThe function that will determine which insight to remove

Definition at line 328 of file InsightCollection.cs.

Here is the call graph for this function:

◆ GetInsights() [1/2]

List<Insight> QuantConnect.Algorithm.Framework.Alphas.InsightCollection.GetInsights ( Func< Insight, bool >  filter = null)

Will return insights from the complete insight collection

Parameters
filterThe function that will determine which insight to return
Returns
A new list containing the selected insights

Definition at line 362 of file InsightCollection.cs.

Here is the caller graph for this function:

◆ GetInsights() [2/2]

List<Insight> QuantConnect.Algorithm.Framework.Alphas.InsightCollection.GetInsights ( PyObject  filter)

Will return insights from the complete insight collection

Parameters
filterThe function that will determine which insight to return
Returns
A new list containing the selected insights

Definition at line 379 of file InsightCollection.cs.

Here is the call graph for this function:

Property Documentation

◆ Count

int QuantConnect.Algorithm.Framework.Alphas.InsightCollection.Count
get

The open insight count

Definition at line 39 of file InsightCollection.cs.

◆ TotalCount

int QuantConnect.Algorithm.Framework.Alphas.InsightCollection.TotalCount
get

The total insight count

Definition at line 53 of file InsightCollection.cs.

◆ this[Symbol symbol]

List<Insight>???? QuantConnect.Algorithm.Framework.Alphas.InsightCollection.this[Symbol symbol]
getset

Dictionary accessor returns a list of insights for the specified symbol

Parameters
symbolThe symbol key
Returns
List of insights for the symbol

Definition at line 154 of file InsightCollection.cs.


The documentation for this class was generated from the following file: