Static Members
28
public static MarketDetails AddMarket(MarketDetails md, bool save = true)
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.
public static SymbolInfo AddSymbol(SymbolInfo si)
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.
public static MarketDetails Cryptos
Returns the MarketDetails instance that represents the cryptocurrency market.
public static MarketDetails Currencies
Returns the MarketDetails instance that represents the Forex currencies market.
public static List<string> CurrencySymbols
Returns a List containing the currency symbols recognized by MarketManager.
public static MarketDetails FindMarket(string name)
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.
public static SymbolInfo FindSymbol(string symbol)
Searches the installed symbol information for the specified symbol.
Returns the matching SymbolInfo instance, or null if no matching symbol is found.
public static Commission GetCommission(MarketDetails market)
public static Commission GetCommission(SymbolInfo si)
Returns the user-defined Commission associated with the specified market or SymbolInfo instance (si).
Returns null if no user-defined commission has been assigned.
public static int GetContractMonth(string code)
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.
public static List<string> HolidaySetNames
Returns a sorted List containing the names of all Holiday Sets installed in MarketManager.
public static Dictionary<string, HolidaySet> HolidaySets
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.
public static void Initialize()
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.
public static bool IsForex(string symbol)
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.
public static List<MarketDetails> Markets
Returns a List containing all of the markets installed in MarketManager, expressed as MarketDetails instances.
public static string MarketsTxt
Returns the name of the file used to persist user-defined market information, "Markets.txt".
public static string MarketsTxtFileName
Returns the complete path and file name of the file used to persist user-defined market information.
public static List<DateTime> RegisterHolidaySet(
string holidaySetName,
string holidays,
double offsetHoursOpen = 0,
double offsetHoursClose = 0)
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.
public static void RemoveMarket(MarketDetails md)
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.
public static void RemoveSymbol(SymbolInfo si)
Removes the SymbolInfo instance specified in si from MarketManager and saves the updated symbol information to persistent storage.
public static void SaveMarkets()
Saves the editable MarketDetails instances in Markets to the WealthLab Markets.txt file.
public static void SaveSymbols()
Saves the SymbolInfo instances in Symbols to the WealthLab Symbols.txt file.
public static void SetCommission(MarketDetails market, Commission c)
public static void SetCommission(SymbolInfo si, Commission c)
Associates the Commission specified in c with a market or individual symbol.
Pass null for c to remove an existing user-defined commission assignment.
public static List<SymbolInfo> Symbols
Returns a List of SymbolInfo instances containing the symbol-specific information installed in MarketManager.
public static string SymbolsTxt
Returns the name of the file used to persist symbol-specific information, "Symbols.txt".
public static string SymbolsTxtFileName
Returns the complete path and file name of the file used to persist symbol-specific information.
public static void UpdateMarket(MarketDetails md)
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.
public static void UpdateSymbol(SymbolInfo si)
Updates the installed symbol information matching the SymbolInfo instance specified in si.
If no matching symbol exists, si is added as a new symbol.
public static MarketDetails UsaStocks
Returns the MarketDetails instance that represents the US stock market.