Lean  $LEAN_TAG$
QuantConnect.Securities.BaseSecurityDatabase< T, TEntry > Class Template Reference

Base class for security databases, including market hours and symbol properties. More...

Public Member Functions

bool ContainsKey (string market, string symbol, SecurityType securityType)
 Check whether an entry exists for the specified market/symbol/security-type More...
 
bool ContainsKey (string market, Symbol symbol, SecurityType securityType)
 Check whether an entry exists for the specified market/symbol/security-type More...
 

Static Public Member Functions

static void Reset ()
 Resets the database, forcing a reload when reused. Called in tests where multiple algorithms are run sequentially, and we need to guarantee that every test starts with the same environment. More...
 
static string GetDatabaseSymbolKey (Symbol symbol)
 Gets the correct string symbol to use as a database key More...
 

Protected Member Functions

 BaseSecurityDatabase (Dictionary< SecurityDatabaseKey, TEntry > entries, Func< T > fromDataFolder, Action< TEntry, TEntry > updateEntry)
 Initializes a new instance of the BaseSecurityDatabase<T, TEntry> class More...
 
bool ContainsKey (SecurityDatabaseKey key)
 Determines if the database contains the specified key More...
 

Static Protected Attributes

static readonly object DataFolderDatabaseLock = new object()
 Lock object for the data folder database More...
 

Properties

static T DataFolderDatabase [get, set]
 The database instance loaded from the data folder More...
 
Dictionary< SecurityDatabaseKey, TEntry > Entries [get, set]
 The database entries More...
 
HashSet< SecurityDatabaseKeyCustomEntries [get]
 Custom entries set by the user. More...
 

Detailed Description

Base class for security databases, including market hours and symbol properties.

Type Constraints
T :BaseSecurityDatabase 
T :T 
T :TEntry 

Definition at line 26 of file BaseSecurityDatabase.cs.

Constructor & Destructor Documentation

◆ BaseSecurityDatabase()

QuantConnect.Securities.BaseSecurityDatabase< T, TEntry >.BaseSecurityDatabase ( Dictionary< SecurityDatabaseKey, TEntry >  entries,
Func< T >  fromDataFolder,
Action< TEntry, TEntry >  updateEntry 
)
protected

Initializes a new instance of the BaseSecurityDatabase<T, TEntry> class

Parameters
entriesThe full listing of exchange hours by key
fromDataFolderMethod to load the database form the data folder
updateEntryMethod to update a database entry

Definition at line 61 of file BaseSecurityDatabase.cs.

Member Function Documentation

◆ Reset()

static void QuantConnect.Securities.BaseSecurityDatabase< T, TEntry >.Reset ( )
static

Resets the database, forcing a reload when reused. Called in tests where multiple algorithms are run sequentially, and we need to guarantee that every test starts with the same environment.

Definition at line 76 of file BaseSecurityDatabase.cs.

◆ ContainsKey() [1/3]

bool QuantConnect.Securities.BaseSecurityDatabase< T, TEntry >.ContainsKey ( SecurityDatabaseKey  key)
protected

Determines if the database contains the specified key

Parameters
keyThe key to search for
Returns
True if an entry is found, otherwise false

Definition at line 138 of file BaseSecurityDatabase.cs.

Here is the caller graph for this function:

◆ ContainsKey() [2/3]

bool QuantConnect.Securities.BaseSecurityDatabase< T, TEntry >.ContainsKey ( string  market,
string  symbol,
SecurityType  securityType 
)

Check whether an entry exists for the specified market/symbol/security-type

Parameters
marketThe market the exchange resides in, i.e, 'usa', 'fxcm', ect...
symbolThe particular symbol being traded
securityTypeThe security type of the symbol

Definition at line 149 of file BaseSecurityDatabase.cs.

◆ ContainsKey() [3/3]

bool QuantConnect.Securities.BaseSecurityDatabase< T, TEntry >.ContainsKey ( string  market,
Symbol  symbol,
SecurityType  securityType 
)

Check whether an entry exists for the specified market/symbol/security-type

Parameters
marketThe market the exchange resides in, i.e, 'usa', 'fxcm', ect...
symbolThe particular symbol being traded (Symbol class)
securityTypeThe security type of the symbol

Definition at line 160 of file BaseSecurityDatabase.cs.

◆ GetDatabaseSymbolKey()

static string QuantConnect.Securities.BaseSecurityDatabase< T, TEntry >.GetDatabaseSymbolKey ( Symbol  symbol)
static

Gets the correct string symbol to use as a database key

Parameters
symbolThe symbol
Returns
The symbol string used in the database ke

Definition at line 174 of file BaseSecurityDatabase.cs.

Here is the caller graph for this function:

Member Data Documentation

◆ DataFolderDatabaseLock

readonly object QuantConnect.Securities.BaseSecurityDatabase< T, TEntry >.DataFolderDatabaseLock = new object()
staticprotected

Lock object for the data folder database

Definition at line 37 of file BaseSecurityDatabase.cs.

Property Documentation

◆ DataFolderDatabase

T QuantConnect.Securities.BaseSecurityDatabase< T, TEntry >.DataFolderDatabase
staticgetsetprotected

The database instance loaded from the data folder

Definition at line 32 of file BaseSecurityDatabase.cs.

◆ Entries

Dictionary<SecurityDatabaseKey, TEntry> QuantConnect.Securities.BaseSecurityDatabase< T, TEntry >.Entries
getsetprotected

The database entries

Definition at line 42 of file BaseSecurityDatabase.cs.

◆ CustomEntries

HashSet<SecurityDatabaseKey> QuantConnect.Securities.BaseSecurityDatabase< T, TEntry >.CustomEntries
getprotected

Custom entries set by the user.

Definition at line 47 of file BaseSecurityDatabase.cs.


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