|
Lean
$LEAN_TAG$
|
Provides access to exchange hours and raw data times zones in various markets More...
Classes | |
| class | Entry |
| Represents a single entry in the MarketHoursDatabase More... | |
Public Member Functions | |
| MarketHoursDatabase (Dictionary< SecurityDatabaseKey, Entry > exchangeHours) | |
| Initializes a new instance of the MarketHoursDatabase class More... | |
| SecurityExchangeHours | GetExchangeHours (SubscriptionDataConfig configuration) |
| Convenience method for retrieving exchange hours from market hours database using a subscription config More... | |
| SecurityExchangeHours | GetExchangeHours (string market, Symbol symbol, SecurityType securityType) |
| Convenience method for retrieving exchange hours from market hours database using a subscription config More... | |
| DateTimeZone | GetDataTimeZone (string market, Symbol symbol, SecurityType securityType) |
| Performs a lookup using the specified information and returns the data's time zone if found, if an entry is not found, an exception is thrown More... | |
| virtual Entry | SetEntry (string market, string symbol, SecurityType securityType, SecurityExchangeHours exchangeHours, DateTimeZone dataTimeZone=null) |
| Sets the entry for the specified market/symbol/security-type. This is intended to be used by custom data and other data sources that don't have explicit entries in market-hours-database.csv. At run time, the algorithm can update the market hours database via calls to AddData. More... | |
| virtual Entry | SetEntryAlwaysOpen (string market, string symbol, SecurityType securityType, DateTimeZone timeZone) |
| Convenience method for the common custom data case. Sets the entry for the specified symbol using SecurityExchangeHours.AlwaysOpen(timeZone) This sets the data time zone equal to the exchange time zone as well. More... | |
| virtual Entry | GetEntry (string market, string symbol, SecurityType securityType) |
| Gets the entry for the specified market/symbol/security-type More... | |
| bool | TryGetEntry (string market, Symbol symbol, SecurityType securityType, out Entry entry) |
| Tries to get the entry for the specified market/symbol/security-type More... | |
| virtual bool | TryGetEntry (string market, string symbol, SecurityType securityType, out Entry entry) |
| Tries to get the entry for the specified market/symbol/security-type More... | |
| virtual Entry | GetEntry (string market, Symbol symbol, SecurityType securityType) |
| Gets the entry for the specified market/symbol/security-type More... | |
Public Member Functions inherited from QuantConnect.Securities.BaseSecurityDatabase< MarketHoursDatabase, MarketHoursDatabase.Entry > | |
| 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 MarketHoursDatabase | FromDataFolder () |
| Gets the instance of the MarketHoursDatabase class produced by reading in the market hours data found in /Data/market-hours/ More... | |
| static MarketHoursDatabase | FromFile (string path) |
| Reads the specified file as a market hours database instance More... | |
Static Public Member Functions inherited from QuantConnect.Securities.BaseSecurityDatabase< MarketHoursDatabase, MarketHoursDatabase.Entry > | |
| 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... | |
Public Attributes | |
| List< KeyValuePair< SecurityDatabaseKey, Entry > > | ExchangeHoursListing => Entries.ToList() |
| Gets all the exchange hours held by this provider More... | |
Properties | |
| static MarketHoursDatabase | AlwaysOpen [get] |
| Gets a MarketHoursDatabase that always returns SecurityExchangeHours.AlwaysOpen More... | |
Properties inherited from QuantConnect.Securities.BaseSecurityDatabase< MarketHoursDatabase, MarketHoursDatabase.Entry > | |
| 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< SecurityDatabaseKey > | CustomEntries [get] |
| Custom entries set by the user. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from QuantConnect.Securities.BaseSecurityDatabase< MarketHoursDatabase, MarketHoursDatabase.Entry > | |
| 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 inherited from QuantConnect.Securities.BaseSecurityDatabase< MarketHoursDatabase, MarketHoursDatabase.Entry > | |
| static readonly object | DataFolderDatabaseLock |
| Lock object for the data folder database More... | |
Provides access to exchange hours and raw data times zones in various markets
Definition at line 34 of file MarketHoursDatabase.cs.
| QuantConnect.Securities.MarketHoursDatabase.MarketHoursDatabase | ( | Dictionary< SecurityDatabaseKey, Entry > | exchangeHours | ) |
Initializes a new instance of the MarketHoursDatabase class
| exchangeHours | The full listing of exchange hours by key |
Definition at line 73 of file MarketHoursDatabase.cs.
| SecurityExchangeHours QuantConnect.Securities.MarketHoursDatabase.GetExchangeHours | ( | SubscriptionDataConfig | configuration | ) |
Convenience method for retrieving exchange hours from market hours database using a subscription config
| configuration | The subscription data config to get exchange hours for |
Definition at line 83 of file MarketHoursDatabase.cs.
| SecurityExchangeHours QuantConnect.Securities.MarketHoursDatabase.GetExchangeHours | ( | string | market, |
| Symbol | symbol, | ||
| SecurityType | securityType | ||
| ) |
Convenience method for retrieving exchange hours from market hours database using a subscription config
| market | The market the exchange resides in, i.e, 'usa', 'fxcm', ect... |
| symbol | The particular symbol being traded |
| securityType | The security type of the symbol |
Definition at line 95 of file MarketHoursDatabase.cs.
| DateTimeZone QuantConnect.Securities.MarketHoursDatabase.GetDataTimeZone | ( | string | market, |
| Symbol | symbol, | ||
| SecurityType | securityType | ||
| ) |
Performs a lookup using the specified information and returns the data's time zone if found, if an entry is not found, an exception is thrown
| market | The market the exchange resides in, i.e, 'usa', 'fxcm', ect... |
| symbol | The particular symbol being traded |
| securityType | The security type of the symbol |
Definition at line 108 of file MarketHoursDatabase.cs.
|
static |
Gets the instance of the MarketHoursDatabase class produced by reading in the market hours data found in /Data/market-hours/
Definition at line 118 of file MarketHoursDatabase.cs.
|
static |
Reads the specified file as a market hours database instance
| path | The market hours database file path |
Definition at line 140 of file MarketHoursDatabase.cs.
|
virtual |
Sets the entry for the specified market/symbol/security-type. This is intended to be used by custom data and other data sources that don't have explicit entries in market-hours-database.csv. At run time, the algorithm can update the market hours database via calls to AddData.
| market | The market the exchange resides in, i.e, 'usa', 'fxcm', ect... |
| symbol | The particular symbol being traded |
| securityType | The security type of the symbol |
| exchangeHours | The exchange hours for the specified symbol |
| dataTimeZone | The time zone of the symbol's raw data. Optional, defaults to the exchange time zone |
Definition at line 157 of file MarketHoursDatabase.cs.
|
virtual |
Convenience method for the common custom data case. Sets the entry for the specified symbol using SecurityExchangeHours.AlwaysOpen(timeZone) This sets the data time zone equal to the exchange time zone as well.
| market | The market the exchange resides in, i.e, 'usa', 'fxcm', ect... |
| symbol | The particular symbol being traded |
| securityType | The security type of the symbol |
| timeZone | The time zone of the symbol's exchange and raw data |
Definition at line 180 of file MarketHoursDatabase.cs.
|
virtual |
Gets the entry for the specified market/symbol/security-type
| market | The market the exchange resides in, i.e, 'usa', 'fxcm', ect... |
| symbol | The particular symbol being traded |
| securityType | The security type of the symbol |
Definition at line 192 of file MarketHoursDatabase.cs.
| bool QuantConnect.Securities.MarketHoursDatabase.TryGetEntry | ( | string | market, |
| Symbol | symbol, | ||
| SecurityType | securityType, | ||
| out Entry | entry | ||
| ) |
Tries to get the entry for the specified market/symbol/security-type
| market | The market the exchange resides in, i.e, 'usa', 'fxcm', ect... |
| symbol | The particular symbol being traded |
| securityType | The security type of the symbol |
| entry | The entry found if any |
Definition at line 230 of file MarketHoursDatabase.cs.
|
virtual |
Tries to get the entry for the specified market/symbol/security-type
| market | The market the exchange resides in, i.e, 'usa', 'fxcm', ect... |
| symbol | The particular symbol being traded |
| securityType | The security type of the symbol |
| entry | The entry found if any |
Definition at line 243 of file MarketHoursDatabase.cs.
|
virtual |
Gets the entry for the specified market/symbol/security-type
| market | The market the exchange resides in, i.e, 'usa', 'fxcm', ect... |
| symbol | The particular symbol being traded (Symbol class) |
| securityType | The security type of the symbol |
Definition at line 269 of file MarketHoursDatabase.cs.
| List<KeyValuePair<SecurityDatabaseKey, Entry> > QuantConnect.Securities.MarketHoursDatabase.ExchangeHoursListing => Entries.ToList() |
Gets all the exchange hours held by this provider
Definition at line 43 of file MarketHoursDatabase.cs.
|
staticget |
Gets a MarketHoursDatabase that always returns SecurityExchangeHours.AlwaysOpen
Definition at line 49 of file MarketHoursDatabase.cs.