Parent:
MarketManager is a static utility class that manages information about markets and symbols in WealthLab. It maintains a collection of MarketDetails instances representing markets such as US stocks, futures, Forex, and cryptocurrencies, as well as SymbolInfo instances containing symbol-specific information. MarketManager is particularly useful to developers of custom Data Provider extensions that need to install or access market and symbol information.
Adds the MarketDetails instance specified in md to the collection of installed markets. If a market with the same name already exists, the existing MarketDetails instance is returned instead. If save is true, the updated market collection is saved to persistent storage. Returns the newly added or existing MarketDetails instance.
Adds the SymbolInfo instance specified in si to the collection of symbol-specific information. If a matching symbol already exists, the existing SymbolInfo instance is returned instead. The symbol collection is sorted and saved to persistent storage after a new symbol is added.
Returns the MarketDetails instance that represents the cryptocurrency market.
Returns the MarketDetails instance that represents the Forex currencies market.
Returns a List containing the currency symbols recognized by MarketManager.
Searches the installed markets for the market whose Name matches the specified name. The comparison is case-insensitive. Returns the matching MarketDetails instance, or null if no matching market is found.
Searches the installed symbol information for the specified symbol. Returns the matching SymbolInfo instance, or null if no matching symbol is found.
Returns the user-defined Commission associated with the specified market or SymbolInfo instance (si). Returns null if no user-defined commission has been assigned.
Converts a futures contract month code into its corresponding month number.
For example, "F" returns 1 for January, "H" returns 3 for March, and "Z" returns 12 for December.
Throws an ArgumentException if code is not a recognized futures contract month code.
Returns a sorted List containing the names of all Holiday Sets installed in MarketManager.
Returns a Dictionary containing the HolidaySet instances installed in MarketManager, keyed by Holiday Set name. A HolidaySet contains the holiday dates and any special market hours associated with a particular market calendar.
Initializes MarketManager by loading user-defined market and symbol information from the WealthLab data folder.
Market information is loaded from Markets.txt, and symbol-specific information is loaded from Symbols.txt.
Returns true if symbol appears to represent a Forex currency pair.
The method recognizes six-character currency pairs such as "EURUSD", as well as common variations using separators or suffixes, such as "EUR/USD", "EUR.USD", and "EURUSD.FOREX". Both three-character components must be recognized currency symbols, and the base and quote currencies must be different.
Returns a List containing all of the markets installed in MarketManager, expressed as MarketDetails instances.
Returns the name of the file used to persist user-defined market information, "Markets.txt".
Returns the complete path and file name of the file used to persist user-defined market information.
Registers a Holiday Set named holidaySetName using the newline-delimited holiday information supplied in holidays.
Standard holiday entries use the yyyy-MM-dd format. Entries can also specify special market hours by supplying the date, opening time, and closing time separated by semicolons.
The optional offsetHoursOpen and offsetHoursClose parameters adjust the special opening and closing times.
Returns a List of DateTime values containing the full-market-closure holiday dates that were registered.
Removes the market specified in md from MarketManager, if it exists and can be edited. Any symbol-specific entries associated with the market are also removed.
Removes the SymbolInfo instance specified in si from MarketManager and saves the updated symbol information to persistent storage.
Saves the editable MarketDetails instances in Markets to the WealthLab Markets.txt file.
Saves the SymbolInfo instances in Symbols to the WealthLab Symbols.txt file.
Associates the Commission specified in c with a market or individual symbol. Pass null for c to remove an existing user-defined commission assignment.
Returns a List of SymbolInfo instances containing the symbol-specific information installed in MarketManager.
Returns the name of the file used to persist symbol-specific information, "Symbols.txt".
Returns the complete path and file name of the file used to persist symbol-specific information.
Updates the installed market whose name matches the MarketDetails instance specified in md. If no matching market exists, md is added as a new market.
Updates the installed symbol information matching the SymbolInfo instance specified in si. If no matching symbol exists, si is added as a new symbol.
Returns the MarketDetails instance that represents the US stock market.